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

Unified Diff: sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc

Issue 1975393002: Check stack pointer to be inside stack when unwinding. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement mincore() approach Created 4 years, 7 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
Index: sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
diff --git a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
index 2bf572c0b3cd84d640db6abbcb7dcadb511060e4..6e4e699797091dc6eaf6657c467f9ab1c8e08ebf 100644
--- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
@@ -11,6 +11,7 @@
#include <sys/types.h>
#include <unistd.h>
+#include "base/debug/debugging_flags.h"
#include "base/logging.h"
#include "build/build_config.h"
#include "sandbox/linux/bpf_dsl/bpf_dsl.h"
@@ -126,6 +127,14 @@ ResultExpr EvaluateSyscallImpl(int fs_denied_errno,
#endif // defined(ADDRESS_SANITIZER) || defined(THREAD_SANITIZER) ||
// defined(MEMORY_SANITIZER)
+#if BUILDFLAG(ENABLE_PROFILING)
+ // Native heap profiler uses mincore() to determine stack boundary,
+ // see base/debug/stack_trace.cc.
+ if (sysno == __NR_mincore) {
+ return Allow();
+ }
+#endif
+
if (IsBaselinePolicyAllowed(sysno)) {
return Allow();
}
« base/debug/stack_trace.cc ('K') | « base/trace_event/heap_profiler_allocation_context_tracker.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698