OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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-helpers/baseline_policy.h" | 5 #include "sandbox/linux/seccomp-bpf-helpers/baseline_policy.h" |
6 | 6 |
7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <linux/futex.h> |
8 #include <sched.h> | 9 #include <sched.h> |
9 #include <signal.h> | 10 #include <signal.h> |
10 #include <string.h> | 11 #include <string.h> |
11 #include <sys/socket.h> | 12 #include <sys/socket.h> |
12 #include <sys/stat.h> | 13 #include <sys/stat.h> |
13 #include <sys/syscall.h> | 14 #include <sys/syscall.h> |
| 15 #include <sys/time.h> |
14 #include <sys/types.h> | 16 #include <sys/types.h> |
15 #include <sys/wait.h> | 17 #include <sys/wait.h> |
16 #include <unistd.h> | 18 #include <unistd.h> |
17 | 19 |
18 #include "base/files/scoped_file.h" | 20 #include "base/files/scoped_file.h" |
19 #include "base/macros.h" | 21 #include "base/macros.h" |
20 #include "base/posix/eintr_wrapper.h" | 22 #include "base/posix/eintr_wrapper.h" |
21 #include "base/threading/thread.h" | 23 #include "base/threading/thread.h" |
22 #include "build/build_config.h" | 24 #include "build/build_config.h" |
23 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" | 25 #include "sandbox/linux/seccomp-bpf-helpers/sigsys_handlers.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 TEST_BASELINE_SIGSYS(__NR_sysinfo); | 236 TEST_BASELINE_SIGSYS(__NR_sysinfo); |
235 TEST_BASELINE_SIGSYS(__NR_inotify_init); | 237 TEST_BASELINE_SIGSYS(__NR_inotify_init); |
236 TEST_BASELINE_SIGSYS(__NR_init_module); | 238 TEST_BASELINE_SIGSYS(__NR_init_module); |
237 TEST_BASELINE_SIGSYS(__NR_keyctl); | 239 TEST_BASELINE_SIGSYS(__NR_keyctl); |
238 TEST_BASELINE_SIGSYS(__NR_mq_open); | 240 TEST_BASELINE_SIGSYS(__NR_mq_open); |
239 TEST_BASELINE_SIGSYS(__NR_vserver); | 241 TEST_BASELINE_SIGSYS(__NR_vserver); |
240 TEST_BASELINE_SIGSYS(__NR_getcpu); | 242 TEST_BASELINE_SIGSYS(__NR_getcpu); |
241 TEST_BASELINE_SIGSYS(__NR_setpgid); | 243 TEST_BASELINE_SIGSYS(__NR_setpgid); |
242 TEST_BASELINE_SIGSYS(__NR_getitimer); | 244 TEST_BASELINE_SIGSYS(__NR_getitimer); |
243 | 245 |
| 246 BPF_DEATH_TEST_C(BaselinePolicy, |
| 247 FutexWithRequeuePriorityInheritence, |
| 248 DEATH_MESSAGE(GetErrorMessageContentForTests()), |
| 249 BaselinePolicy) { |
| 250 syscall(__NR_futex, NULL, FUTEX_CMP_REQUEUE_PI, 0, NULL, NULL, 0); |
| 251 _exit(1); |
| 252 } |
| 253 |
| 254 BPF_DEATH_TEST_C(BaselinePolicy, |
| 255 FutexWithBannedBit, |
| 256 DEATH_MESSAGE(GetErrorMessageContentForTests()), |
| 257 BaselinePolicy) { |
| 258 syscall(__NR_futex, NULL, 512 | FUTEX_WAKE , 0, NULL, NULL, 0); |
| 259 _exit(1); |
| 260 } |
| 261 |
| 262 |
244 } // namespace | 263 } // namespace |
245 | 264 |
246 } // namespace sandbox | 265 } // namespace sandbox |
OLD | NEW |