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

Unified Diff: sandbox/linux/seccomp-bpf/trap.cc

Issue 937303005: Revert of bpf_dsl: decouple PolicyCompiler from Syscall (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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 | « sandbox/linux/seccomp-bpf/trap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp-bpf/trap.cc
diff --git a/sandbox/linux/seccomp-bpf/trap.cc b/sandbox/linux/seccomp-bpf/trap.cc
index 145e62469cacca37c07aa40916c1d27795082c11..c87bb006129d15d006034daf36323f434b51ff6a 100644
--- a/sandbox/linux/seccomp-bpf/trap.cc
+++ b/sandbox/linux/seccomp-bpf/trap.cc
@@ -251,6 +251,10 @@
}
}
+uint16_t Trap::MakeTrap(TrapFnc fnc, const void* aux, bool safe) {
+ return Registry()->Add(fnc, aux, safe);
+}
+
uint16_t Trap::Add(TrapFnc fnc, const void* aux, bool safe) {
if (!safe && !SandboxDebuggingAllowedByUser()) {
// Unless the user set the CHROME_SANDBOX_DEBUGGING environment variable,
@@ -349,9 +353,13 @@
return id;
}
-bool Trap::SandboxDebuggingAllowedByUser() {
+bool Trap::SandboxDebuggingAllowedByUser() const {
const char* debug_flag = getenv(kSandboxDebuggingEnv);
return debug_flag && *debug_flag;
+}
+
+bool Trap::EnableUnsafeTrapsInSigSysHandler() {
+ return Registry()->EnableUnsafeTraps();
}
bool Trap::EnableUnsafeTraps() {
« no previous file with comments | « sandbox/linux/seccomp-bpf/trap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698