PenYiWang via llvm-dev
2018-Aug-08 02:01 UTC
[llvm-dev] Which are CFI (Control Flow Integrity) related files?
Hi I want to trace the code of clang/llvm CFI (Control Flow Integrity) mechanism I found that there is ForwardControlFlowIntegrity.cpp in llvm 3.6 https://github.com/llvm-mirror/llvm/blob/release_36/lib/CodeGen/ ForwardControlFlowIntegrity.cpp But I don't know which files implement CFI (Control Flow Integrity) in later version (1) If I use this command clang-6.0 -fsanitize=cfi-icall -fvisibility=hidden -flto ./test.c Which files implement CFI ? (2) I found these two files but I set break point in gdb , and didn't find anything (gdb) b llvm::CrossDSOCFI::buildCFICheck https://github.com/llvm-mirror/llvm/blob/release_60/lib/Transforms/IPO/ LowerTypeTests.cpp https://github.com/llvm-mirror/llvm/blob/release_60/lib/Transforms/IPO/ CrossDSOCFI.cpp (3) What's "MCCFIInstruction" ? Does it relate to CFI (Control Flow Integrity) ? http://llvm.org/doxygen/classllvm_1_1MCCFIInstruction.html Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180808/abde9d9a/attachment-0001.html>
Peter Collingbourne via llvm-dev
2018-Aug-08 02:10 UTC
[llvm-dev] Which are CFI (Control Flow Integrity) related files?
On Tue, Aug 7, 2018 at 7:02 PM PenYiWang via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi > > I want to trace the code of clang/llvm CFI (Control Flow Integrity) > mechanism > > I found that there is ForwardControlFlowIntegrity.cpp in llvm 3.6 > > > https://github.com/llvm-mirror/llvm/blob/release_36/lib/CodeGen/ForwardControlFlowIntegrity.cpp > > But I don't know which files implement CFI (Control Flow Integrity) in > later version > > (1) > > If I use this command > > clang-6.0 -fsanitize=cfi-icall -fvisibility=hidden -flto ./test.c > > Which files implement CFI ? >In that case it would be LowerTypeTests.cpp as well as parts of clang/lib/CodeGen (grep for CFIICall).> > (2) > > I found these two files > > but I set break point in gdb , and didn't find anything > > (gdb) b llvm::CrossDSOCFI::buildCFICheck > > > https://github.com/llvm-mirror/llvm/blob/release_60/lib/Transforms/IPO/LowerTypeTests.cpp > > https://github.com/llvm-mirror/llvm/blob/release_60/lib/Transforms/IPO/CrossDSOCFI.cpp >The CrossDSOCFI.cpp file is only involved in implementing cross-DSO CFI (i.e. -fsanitize-cfi-cross-dso). If you don't request cross-DSO CFI only LowerTypeTests.cpp is used.> (3) > > What's "MCCFIInstruction" ? > > Does it relate to CFI (Control Flow Integrity) ? > > http://llvm.org/doxygen/classllvm_1_1MCCFIInstruction.html >No, that's a different CFI. Peter> > > Thanks > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-- -- Peter -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180807/3e1c6422/attachment.html>