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

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

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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/instruction.h ('k') | sandbox/linux/services/credentials.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d5a5d4d983e75e23123d70e0c47349e549217a9f..43c9af6f339be05c5a841da22474b3449144ab17 100644
--- a/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
+++ b/sandbox/linux/seccomp-bpf/sandbox_bpf.cc
@@ -41,6 +41,7 @@
#include "sandbox/linux/seccomp-bpf/trap.h"
#include "sandbox/linux/seccomp-bpf/verifier.h"
#include "sandbox/linux/services/linux_syscalls.h"
+#include "sandbox/linux/services/syscall_wrappers.h"
using sandbox::bpf_dsl::Allow;
using sandbox::bpf_dsl::Error;
@@ -92,8 +93,8 @@ class ProbePolicy : public bpf_dsl::Policy {
};
void ProbeProcess(void) {
- if (syscall(__NR_getpid) < 0 && errno == EPERM) {
- syscall(__NR_exit_group, static_cast<intptr_t>(kExpectedExitCode));
+ if (sys_getpid() < 0 && errno == EPERM) {
+ sys_exit_group(kExpectedExitCode);
}
}
@@ -117,7 +118,7 @@ void TryVsyscallProcess(void) {
// vsyscall=emulate and some versions of the seccomp BPF patch
// we may get SIGKILL-ed. Detect this!
if (time(&current_time) != static_cast<time_t>(-1)) {
- syscall(__NR_exit_group, static_cast<intptr_t>(kExpectedExitCode));
+ sys_exit_group(kExpectedExitCode);
}
}
« no previous file with comments | « sandbox/linux/seccomp-bpf/instruction.h ('k') | sandbox/linux/services/credentials.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698