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

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

Issue 661393004: Syscall: Fix Syscall::Call's X86-64 implementation for CFI unwinding (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak wording 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
« no previous file with comments | « no previous file | sandbox/linux/seccomp-bpf/syscall.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <fcntl.h> 8 #include <fcntl.h>
9 #include <linux/futex.h> 9 #include <linux/futex.h>
10 #include <sched.h> 10 #include <sched.h>
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 } 206 }
207 207
208 BPF_TEST_C(BaselinePolicy, EPERM_getcwd, BaselinePolicy) { 208 BPF_TEST_C(BaselinePolicy, EPERM_getcwd, BaselinePolicy) {
209 errno = 0; 209 errno = 0;
210 char buf[1024]; 210 char buf[1024];
211 char* cwd = getcwd(buf, sizeof(buf)); 211 char* cwd = getcwd(buf, sizeof(buf));
212 BPF_ASSERT_EQ(NULL, cwd); 212 BPF_ASSERT_EQ(NULL, cwd);
213 BPF_ASSERT_EQ(EPERM, errno); 213 BPF_ASSERT_EQ(EPERM, errno);
214 } 214 }
215 215
216 // TODO(jorgelo): re-enable this after crbug.com/424973 is fixed.
217 #if !defined(OS_CHROMEOS)
218 BPF_DEATH_TEST_C(BaselinePolicy, 216 BPF_DEATH_TEST_C(BaselinePolicy,
219 SIGSYS_InvalidSyscall, 217 SIGSYS_InvalidSyscall,
220 DEATH_SEGV_MESSAGE(GetErrorMessageContentForTests()), 218 DEATH_SEGV_MESSAGE(GetErrorMessageContentForTests()),
221 BaselinePolicy) { 219 BaselinePolicy) {
222 Syscall::InvalidCall(); 220 Syscall::InvalidCall();
223 } 221 }
224 #endif
225 222
226 // A failing test using this macro could be problematic since we perform 223 // A failing test using this macro could be problematic since we perform
227 // system calls by passing "0" as every argument. 224 // system calls by passing "0" as every argument.
228 // The kernel could SIGSEGV the process or the system call itself could reboot 225 // The kernel could SIGSEGV the process or the system call itself could reboot
229 // the machine. Some thoughts have been given when hand-picking the system 226 // the machine. Some thoughts have been given when hand-picking the system
230 // calls below to limit any potential side effects outside of the current 227 // calls below to limit any potential side effects outside of the current
231 // process. 228 // process.
232 #define TEST_BASELINE_SIGSYS(sysno) \ 229 #define TEST_BASELINE_SIGSYS(sysno) \
233 BPF_DEATH_TEST_C(BaselinePolicy, \ 230 BPF_DEATH_TEST_C(BaselinePolicy, \
234 SIGSYS_##sysno, \ 231 SIGSYS_##sysno, \
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 ClockGettimeWithDisallowedClockCrashes, 342 ClockGettimeWithDisallowedClockCrashes,
346 DEATH_SEGV_MESSAGE(sandbox::GetErrorMessageContentForTests()), 343 DEATH_SEGV_MESSAGE(sandbox::GetErrorMessageContentForTests()),
347 BaselinePolicy) { 344 BaselinePolicy) {
348 struct timespec ts; 345 struct timespec ts;
349 clock_gettime(CLOCK_MONOTONIC_RAW, &ts); 346 clock_gettime(CLOCK_MONOTONIC_RAW, &ts);
350 } 347 }
351 348
352 } // namespace 349 } // namespace
353 350
354 } // namespace sandbox 351 } // namespace sandbox
OLDNEW
« no previous file with comments | « no previous file | sandbox/linux/seccomp-bpf/syscall.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698