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

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

Issue 253753003: Enable use_sigaltstack=1 for ASan builds. This will ease the stack overflow detection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move __NR_sigaltstack to baseline_policy.cc Created 6 years, 8 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 508ae3ebf91176592073a27cb5883c455ec053a1..79b5b023da4f07d429d18fe7a101c684ec7eb381 100644
--- a/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
+++ b/sandbox/linux/seccomp-bpf-helpers/baseline_policy.cc
@@ -86,6 +86,13 @@ ErrorCode EvaluateSyscallImpl(int fs_denied_errno,
pid_t current_pid,
SandboxBPF* sandbox,
int sysno) {
+#if defined(ADDRESS_SANITIZER)
+ if (sysno == __NR_sigaltstack) {
+ // Required for better stack overflow detection in ASan. Disallowed in
+ // non-ASan builds.
+ return ErrorCode(ErrorCode::ERR_ALLOWED);
+ }
+#endif
if (IsBaselinePolicyAllowed(sysno)) {
return ErrorCode(ErrorCode::ERR_ALLOWED);
}

Powered by Google App Engine
This is Rietveld 408576698