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

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

Issue 1302043002: sandbox/linux: refactor bpf_dsl dependency on die.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use logging.h instead of errx 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
Index: sandbox/linux/seccomp-bpf/sandbox_bpf.cc
diff --git a/sandbox/linux/seccomp-bpf/sandbox_bpf.cc b/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
index 77faba4a47bd683f2d08705c7d2904f2575e9d58..ddfdd69d78f0818ac95084aa597ab0d017c633e4 100644
--- a/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
+++ b/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
@@ -109,6 +109,10 @@ uint64_t EscapePC() {
return static_cast<uint64_t>(static_cast<uintptr_t>(rv));
}
+intptr_t SandboxPanic(const struct arch_seccomp_data&, void* aux) {
+ SANDBOX_DIE(static_cast<char*>(aux));
+}
+
} // namespace
SandboxBPF::SandboxBPF(bpf_dsl::Policy* policy)
@@ -219,6 +223,7 @@ scoped_ptr<CodeGen::Program> SandboxBPF::AssembleFilter(
if (Trap::SandboxDebuggingAllowedByUser()) {
compiler.DangerousSetEscapePC(EscapePC());
}
+ compiler.SetPanicFunc(SandboxPanic);
return compiler.Compile(force_verification);
}

Powered by Google App Engine
This is Rietveld 408576698