Add support for the -fsanitize=shadow-call-stack flag which causes clang
to add ShadowCallStack attribute to functions compiled with that flag
enabled.
Details
Diff Detail
- Repository
- rC Clang
- Build Status
Buildable 16361 Build 16361: arc lint + arc unit
Event Timeline
[didn't look at the code yet, just at the docs]
Please add a docs section describing how to handle leaf functions.
If they are not handled yet, no need to change the implementation in these pathches -- ok to do it later.
docs/ShadowCallStack.rst | ||
---|---|---|
15 | prologue/epilogue? | |
21 | Provide short comparison with RFG (more instructions, less memory, same racy attack) | |
39 | link to wikipedia maybe? | |
42 | ... due to return branch predictor (or some such) | |
48 | Say something about attacks that first try to discover the secret location of the shadow call stack. | |
75 | Please add a section that shows the assembly for the following example: int foo() { return bar() + 1; } |
LGTM modulo prolog vs prlogue and epilog vs epilogue
https://en.wiktionary.org/wiki/epilog says these are alternative spellings, so up to you.
docs/ShadowCallStack.rst | ||
---|---|---|
15 | PTAL |
docs/ShadowCallStack.rst | ||
---|---|---|
15 | Forgot to submit this comment: It's used both ways across LLVM but I chose to go with this one just because that's how the PrologEpilogInserter pass wrote it. |
cfe/trunk/test/Driver/sanitizer-ld.c | ||
---|---|---|
563 ↗ | (On Diff #140869) | sanitizer-ld.c is for linker option tests. This merely checks incompatibility of compile flags and fsanitize.c may be more suitable. |
prologue/epilogue?
(it's your native tongue, not mine, though)