SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
29
devel/llvm/patches/patch-include_llvm_InitializePasses_h
Normal file
29
devel/llvm/patches/patch-include_llvm_InitializePasses_h
Normal file
|
@ -0,0 +1,29 @@
|
|||
Add RETGUARD to clang for amd64. This security mechanism uses per-function
|
||||
random cookies to protect access to function return instructions, with the
|
||||
effect that the integrity of the return address is protected, and function
|
||||
return instructions are harder to use in ROP gadgets.
|
||||
|
||||
On function entry the return address is combined with a per-function random
|
||||
cookie and stored in the stack frame. The integrity of this value is verified
|
||||
before function return, and if this check fails, the program aborts. In this way
|
||||
RETGUARD is an improved stack protector, since the cookies are per-function. The
|
||||
verification routine is constructed such that the binary space immediately
|
||||
before each ret instruction is padded with int03 instructions, which makes these
|
||||
return instructions difficult to use in ROP gadgets. In the kernel, this has the
|
||||
effect of removing approximately 50% of total ROP gadgets, and 15% of unique
|
||||
ROP gadgets compared to the 6.3 release kernel. Function epilogues are
|
||||
essentially gadget free, leaving only the polymorphic gadgets that result from
|
||||
jumping into the instruction stream partway through other instructions. Work to
|
||||
remove these gadgets will continue through other mechanisms.
|
||||
|
||||
Index: include/llvm/InitializePasses.h
|
||||
--- include/llvm/InitializePasses.h.orig
|
||||
+++ include/llvm/InitializePasses.h
|
||||
@@ -387,6 +387,7 @@ void initializeRemoveRedundantDebugValuesPass(PassRegi
|
||||
void initializeRenameIndependentSubregsPass(PassRegistry&);
|
||||
void initializeReplaceWithVeclibLegacyPass(PassRegistry &);
|
||||
void initializeResetMachineFunctionPass(PassRegistry&);
|
||||
+void initializeReturnProtectorPass(PassRegistry&);
|
||||
void initializeReversePostOrderFunctionAttrsLegacyPassPass(PassRegistry&);
|
||||
void initializeRewriteStatepointsForGCLegacyPassPass(PassRegistry &);
|
||||
void initializeRewriteSymbolsLegacyPassPass(PassRegistry&);
|
Loading…
Add table
Add a link
Reference in a new issue