HomePhabricator

[RISCV] Support Shadow Call Stack

Authored by zzheng on Mar 26 2020, 10:09 PM.

Description

[RISCV] Support Shadow Call Stack

Currenlty assume x18 is used as pointer to shadow call stack. User shall pass
flags:

"-fsanitize=shadow-call-stack -ffixed-x18"

Runtime supported is needed to setup x18.

If SCS is desired, all parts of the program should be built with -ffixed-x18 to
maintain inter-operatability.

There's no particuluar reason that we must use x18 as SCS pointer. Any register
may be used, as long as it does not have designated purpose already, like RA or
passing call arguments.

Differential Revision: https://reviews.llvm.org/D84414

Details

Committed
zzhengSep 17 2020, 4:02 PM
Differential Revision
D84414: [RISCV] Support Shadow Call Stack
Parents
rGb04c181ed776: [AArch64] Enable implicit null check transformation
Branches
Unknown
Tags
Unknown

Event Timeline

Cool patch, it would be great to update the clang documentation to mention this works on RISC-V now:
https://clang.llvm.org/docs/ShadowCallStack.html