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

Unified Diff: sandbox/linux/seccomp-bpf/bpf_tests_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/seccomp-bpf/basicblock.cc ('k') | sandbox/linux/seccomp-bpf/codegen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/linux/seccomp-bpf/bpf_tests_unittest.cc
diff --git a/sandbox/linux/seccomp-bpf/bpf_tests_unittest.cc b/sandbox/linux/seccomp-bpf/bpf_tests_unittest.cc
index 9d2bb7993c6493a1e3d187a2eba4294e9a0cf41a..192e68ddfc9d5a2cb52e92d4bd7f1908ed0ceb41 100644
--- a/sandbox/linux/seccomp-bpf/bpf_tests_unittest.cc
+++ b/sandbox/linux/seccomp-bpf/bpf_tests_unittest.cc
@@ -17,6 +17,7 @@
#include "sandbox/linux/bpf_dsl/policy.h"
#include "sandbox/linux/seccomp-bpf/sandbox_bpf.h"
#include "sandbox/linux/services/linux_syscalls.h"
+#include "sandbox/linux/services/syscall_wrappers.h"
#include "sandbox/linux/tests/unit_tests.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -82,13 +83,11 @@ TEST(BPFTest, BPFTesterCompatibilityDelegateLeakTest) {
class EnosysPtracePolicy : public bpf_dsl::Policy {
public:
- EnosysPtracePolicy() {
- my_pid_ = syscall(__NR_getpid);
- }
+ EnosysPtracePolicy() { my_pid_ = sys_getpid(); }
virtual ~EnosysPtracePolicy() {
// Policies should be able to bind with the process on which they are
// created. They should never be created in a parent process.
- BPF_ASSERT_EQ(my_pid_, syscall(__NR_getpid));
+ BPF_ASSERT_EQ(my_pid_, sys_getpid());
}
virtual ResultExpr EvaluateSyscall(int system_call_number) const override {
@@ -96,7 +95,7 @@ class EnosysPtracePolicy : public bpf_dsl::Policy {
if (system_call_number == __NR_ptrace) {
// The EvaluateSyscall function should run in the process that created
// the current object.
- BPF_ASSERT_EQ(my_pid_, syscall(__NR_getpid));
+ BPF_ASSERT_EQ(my_pid_, sys_getpid());
return Error(ENOSYS);
} else {
return Allow();
« no previous file with comments | « sandbox/linux/seccomp-bpf/basicblock.cc ('k') | sandbox/linux/seccomp-bpf/codegen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698