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
- rL LLVM
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 | ||
|---|---|---|
| 14 ↗ | (On Diff #139554) | prologue/epilogue? |
| 20 ↗ | (On Diff #139554) | Provide short comparison with RFG (more instructions, less memory, same racy attack) |
| 38 ↗ | (On Diff #139554) | link to wikipedia maybe? |
| 41 ↗ | (On Diff #139554) | ... due to return branch predictor (or some such) |
| 47 ↗ | (On Diff #139554) | Say something about attacks that first try to discover the secret location of the shadow call stack. |
| 74 ↗ | (On Diff #139554) | 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 | ||
|---|---|---|
| 14 ↗ | (On Diff #139554) | PTAL |
| docs/ShadowCallStack.rst | ||
|---|---|---|
| 14 ↗ | (On Diff #139554) | 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 | sanitizer-ld.c is for linker option tests. This merely checks incompatibility of compile flags and fsanitize.c may be more suitable. | |
sanitizer-ld.c is for linker option tests. This merely checks incompatibility of compile flags and fsanitize.c may be more suitable.