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

Side by Side Diff: sandbox/linux/seccomp-bpf/syscall_unittest.cc

Issue 628233002: replace OVERRIDE and FINAL with override and final in sandbox/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "sandbox/linux/seccomp-bpf/syscall.h" 5 #include "sandbox/linux/seccomp-bpf/syscall.h"
6 6
7 #include <asm/unistd.h> 7 #include <asm/unistd.h>
8 #include <fcntl.h> 8 #include <fcntl.h>
9 #include <sys/mman.h> 9 #include <sys/mman.h>
10 #include <sys/syscall.h> 10 #include <sys/syscall.h>
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 BPF_ASSERT(arraysize(args.args) == 6); 103 BPF_ASSERT(arraysize(args.args) == 6);
104 seen_syscall_args->assign(args.args, args.args + arraysize(args.args)); 104 seen_syscall_args->assign(args.args, args.args + arraysize(args.args));
105 return -ENOMEM; 105 return -ENOMEM;
106 } 106 }
107 107
108 class CopyAllArgsOnUnamePolicy : public SandboxBPFDSLPolicy { 108 class CopyAllArgsOnUnamePolicy : public SandboxBPFDSLPolicy {
109 public: 109 public:
110 explicit CopyAllArgsOnUnamePolicy(std::vector<uint64_t>* aux) : aux_(aux) {} 110 explicit CopyAllArgsOnUnamePolicy(std::vector<uint64_t>* aux) : aux_(aux) {}
111 virtual ~CopyAllArgsOnUnamePolicy() {} 111 virtual ~CopyAllArgsOnUnamePolicy() {}
112 112
113 virtual ResultExpr EvaluateSyscall(int sysno) const OVERRIDE { 113 virtual ResultExpr EvaluateSyscall(int sysno) const override {
114 DCHECK(SandboxBPF::IsValidSyscallNumber(sysno)); 114 DCHECK(SandboxBPF::IsValidSyscallNumber(sysno));
115 if (sysno == __NR_uname) { 115 if (sysno == __NR_uname) {
116 return Trap(CopySyscallArgsToAux, aux_); 116 return Trap(CopySyscallArgsToAux, aux_);
117 } else { 117 } else {
118 return Allow(); 118 return Allow();
119 } 119 }
120 } 120 }
121 121
122 private: 122 private:
123 std::vector<uint64_t>* aux_; 123 std::vector<uint64_t>* aux_;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
232 232
233 // Clean up 233 // Clean up
234 EXPECT_EQ(0, Syscall::Call(__NR_munmap, addr2, 8192L)); 234 EXPECT_EQ(0, Syscall::Call(__NR_munmap, addr2, 8192L));
235 EXPECT_EQ(0, Syscall::Call(__NR_munmap, addr3, 4096L)); 235 EXPECT_EQ(0, Syscall::Call(__NR_munmap, addr3, 4096L));
236 EXPECT_EQ(0, IGNORE_EINTR(Syscall::Call(__NR_close, fd))); 236 EXPECT_EQ(0, IGNORE_EINTR(Syscall::Call(__NR_close, fd)));
237 } 237 }
238 238
239 } // namespace 239 } // namespace
240 240
241 } // namespace sandbox 241 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/linux/seccomp-bpf/sandbox_bpf_test_runner.h ('k') | sandbox/linux/tests/sandbox_test_runner_function_pointer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698