Chromium Code Reviews| Index: base/debug/stack_trace_posix.cc |
| diff --git a/base/debug/stack_trace_posix.cc b/base/debug/stack_trace_posix.cc |
| index 9593962d3aa838019b839c3df8a36ff9facd2a83..fe8934a2ae9830971623b98ea8150673e3eb899e 100644 |
| --- a/base/debug/stack_trace_posix.cc |
| +++ b/base/debug/stack_trace_posix.cc |
| @@ -281,6 +281,17 @@ void StackDumpSignalHandler(int signal, siginfo_t* info, void* void_context) { |
| } |
| PrintToStderr("\n"); |
| +#if defined(CFI_ENFORCEMENT) |
| + if (signal == SIGILL && info->si_code == ILL_ILLOPN) { |
| + PrintToStderr( |
| + "CFI: Most likely a control flow integrity violation; for more " |
| + "information see:\n"); |
| + PrintToStderr( |
| + "https://sites.google.com/a/chromium.org/dev/developers/testing/" |
| + "control-flow-integrity\n"); |
|
Avi (use Gerrit)
2015/08/05 15:19:35
FYI, rather than the sites page URL, use
https://
pcc1
2015/08/05 19:58:15
Done.
|
| + } |
| +#endif |
| + |
| debug::StackTrace().Print(); |
| #if defined(OS_LINUX) |
| @@ -395,6 +406,13 @@ void StackDumpSignalHandler(int signal, siginfo_t* info, void* void_context) { |
| write(STDERR_FILENO, buf, std::min(len, sizeof(buf) - 1)); |
| #endif // ARCH_CPU_32_BITS |
| #endif // defined(OS_MACOSX) |
| + |
| +#if defined(CFI_ENFORCEMENT) |
| + if (signal == SIGILL && info->si_code == ILL_ILLOPN) { |
| + PrintToStderr("CFI: Aborting\n"); |
| + } |
| +#endif |
| + |
| _exit(1); |
| } |