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

Unified Diff: sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.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/BUILD.gn ('k') | sandbox/linux/sandbox_linux.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.cc
diff --git a/sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.cc b/sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.cc
index b3d9126bdb90700698f6c69bc775508f50b73caa..66669e796c69dbba717395c2a4772c96f5716aa3 100644
--- a/sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.cc
+++ b/sandbox/linux/bpf_dsl/bpf_dsl_more_unittest.cc
@@ -41,6 +41,7 @@
#include "sandbox/linux/seccomp-bpf/syscall.h"
#include "sandbox/linux/seccomp-bpf/trap.h"
#include "sandbox/linux/services/linux_syscalls.h"
+#include "sandbox/linux/services/syscall_wrappers.h"
#include "sandbox/linux/syscall_broker/broker_process.h"
#include "sandbox/linux/tests/scoped_temporary_file.h"
#include "sandbox/linux/tests/unit_tests.h"
@@ -203,7 +204,7 @@ class WhitelistGetpidPolicy : public Policy {
BPF_TEST_C(SandboxBPF, ApplyBasicWhitelistPolicy, WhitelistGetpidPolicy) {
// getpid() should be allowed
errno = 0;
- BPF_ASSERT(syscall(__NR_getpid) > 0);
+ BPF_ASSERT(sys_getpid() > 0);
BPF_ASSERT(errno == 0);
// getpgid() should be denied
@@ -246,7 +247,7 @@ BPF_TEST(SandboxBPF,
int /* (*BPF_AUX) */) {
// getpid() should work properly
errno = 0;
- BPF_ASSERT(syscall(__NR_getpid) > 0);
+ BPF_ASSERT(sys_getpid() > 0);
BPF_ASSERT(errno == 0);
// Our Auxiliary Data, should be reset by the signal handler
@@ -512,7 +513,7 @@ intptr_t CountSyscalls(const struct arch_seccomp_data& args, void* aux) {
// Verify that within the callback function all filtering is temporarily
// disabled.
- BPF_ASSERT(syscall(__NR_getpid) > 1);
+ BPF_ASSERT(sys_getpid() > 1);
// Verify that we can now call the underlying system call without causing
// infinite recursion.
@@ -549,7 +550,7 @@ class GreyListedPolicy : public Policy {
};
BPF_TEST(SandboxBPF, GreyListedPolicy, GreyListedPolicy, int /* (*BPF_AUX) */) {
- BPF_ASSERT(syscall(__NR_getpid) == -1);
+ BPF_ASSERT(sys_getpid() == -1);
BPF_ASSERT(errno == EPERM);
BPF_ASSERT(*BPF_AUX == 0);
BPF_ASSERT(syscall(__NR_geteuid) == syscall(__NR_getuid));
@@ -2098,7 +2099,7 @@ SANDBOX_TEST(SandboxBPF, DISABLE_ON_TSAN(SeccompRetTrace)) {
BPF_ASSERT(sandbox.StartSandbox(SandboxBPF::PROCESS_SINGLE_THREADED));
// getpid is allowed.
- BPF_ASSERT_EQ(my_pid, syscall(__NR_getpid));
+ BPF_ASSERT_EQ(my_pid, sys_getpid());
// write to stdout is skipped and returns a fake value.
BPF_ASSERT_EQ(kExpectedReturnValue,
« no previous file with comments | « sandbox/linux/BUILD.gn ('k') | sandbox/linux/sandbox_linux.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698