summaryrefslogtreecommitdiff
path: root/lib/sanitizer_common/sanitizer_common_libcdep.cc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sanitizer_common/sanitizer_common_libcdep.cc')
-rw-r--r--lib/sanitizer_common/sanitizer_common_libcdep.cc26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/sanitizer_common/sanitizer_common_libcdep.cc b/lib/sanitizer_common/sanitizer_common_libcdep.cc
index 5cdfbbb27..6ba6f62c1 100644
--- a/lib/sanitizer_common/sanitizer_common_libcdep.cc
+++ b/lib/sanitizer_common/sanitizer_common_libcdep.cc
@@ -81,6 +81,32 @@ void ReportErrorSummary(const char *error_type, const StackTrace *stack,
#endif
}
+void ReportMmapWriteExec() {
+ ScopedErrorReportLock l;
+
+ SanitizerCommonDecorator d;
+
+#if !SANITIZER_GO
+ BufferedStackTrace stack;
+ uptr top = 0;
+ uptr bottom = 0;
+ GET_CALLER_PC_BP_SP;
+ (void)sp;
+ bool fast = common_flags()->fast_unwind_on_fatal;
+ if (fast)
+ GetThreadStackTopAndBottom(false, &top, &bottom);
+ stack.Unwind(kStackTraceMax, pc, bp, nullptr, top, bottom, fast);
+#endif
+
+ Printf("%s", d.Warning());
+ Report("WARNING: %s: writable-executable page usage\n", SanitizerToolName);
+ Printf("%s", d.Default());
+#if !SANITIZER_GO
+ stack.Print();
+ ReportErrorSummary("w-and-x-usage", &stack);
+#endif
+}
+
static void (*SoftRssLimitExceededCallback)(bool exceeded);
void SetSoftRssLimitExceededCallback(void (*Callback)(bool exceeded)) {
CHECK_EQ(SoftRssLimitExceededCallback, nullptr);