Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3083)

Unified Diff: base/debug/stack_trace_posix.cc

Issue 1267423002: CFI: Add diagnostic information to likely CFI violation stack traces. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update URL Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..2067f6c12573cbc9d7405914a1af63c35779a9fb 100644
--- a/base/debug/stack_trace_posix.cc
+++ b/base/debug/stack_trace_posix.cc
@@ -281,6 +281,16 @@ 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://www.chromium.org/developers/testing/control-flow-integrity\n");
+ }
+#endif
+
debug::StackTrace().Print();
#if defined(OS_LINUX)
@@ -395,6 +405,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
Nico 2015/08/05 20:59:07 this block seems to not add anything useful
pcc1 2015/08/05 21:00:30 It acts as an end marker for the problem report. C
+
_exit(1);
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698