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

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

Issue 278583005: Linux Sandbox: Add support for SECCOMP_RET_TRACE. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix LOG(FATAL) behavior on Android. Created 6 years, 6 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 | « sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc ('k') | sandbox/linux/tests/main.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 (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 <string.h> 5 #include <string.h>
6 6
7 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h" 7 #include "sandbox/linux/seccomp-bpf/sandbox_bpf.h"
8 #include "sandbox/linux/seccomp-bpf/sandbox_bpf_policy.h" 8 #include "sandbox/linux/seccomp-bpf/sandbox_bpf_policy.h"
9 #include "sandbox/linux/seccomp-bpf/syscall_iterator.h" 9 #include "sandbox/linux/seccomp-bpf/syscall_iterator.h"
10 #include "sandbox/linux/seccomp-bpf/verifier.h" 10 #include "sandbox/linux/seccomp-bpf/verifier.h"
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after
416 Ld(&state, insn, err); 416 Ld(&state, insn, err);
417 break; 417 break;
418 case BPF_JMP: 418 case BPF_JMP:
419 Jmp(&state, insn, err); 419 Jmp(&state, insn, err);
420 break; 420 break;
421 case BPF_RET: { 421 case BPF_RET: {
422 uint32_t r = Ret(&state, insn, err); 422 uint32_t r = Ret(&state, insn, err);
423 switch (r & SECCOMP_RET_ACTION) { 423 switch (r & SECCOMP_RET_ACTION) {
424 case SECCOMP_RET_TRAP: 424 case SECCOMP_RET_TRAP:
425 case SECCOMP_RET_ERRNO: 425 case SECCOMP_RET_ERRNO:
426 case SECCOMP_RET_TRACE:
426 case SECCOMP_RET_ALLOW: 427 case SECCOMP_RET_ALLOW:
427 break; 428 break;
428 case SECCOMP_RET_KILL: // We don't ever generate this 429 case SECCOMP_RET_KILL: // We don't ever generate this
429 case SECCOMP_RET_TRACE: // We don't ever generate this
430 case SECCOMP_RET_INVALID: // Should never show up in BPF program 430 case SECCOMP_RET_INVALID: // Should never show up in BPF program
431 default: 431 default:
432 *err = "Unexpected return code found in BPF program"; 432 *err = "Unexpected return code found in BPF program";
433 return 0; 433 return 0;
434 } 434 }
435 return r; 435 return r;
436 } 436 }
437 case BPF_ALU: 437 case BPF_ALU:
438 Alu(&state, insn, err); 438 Alu(&state, insn, err);
439 break; 439 break;
440 default: 440 default:
441 *err = "Unexpected instruction in BPF program"; 441 *err = "Unexpected instruction in BPF program";
442 break; 442 break;
443 } 443 }
444 } 444 }
445 return 0; 445 return 0;
446 } 446 }
447 447
448 } // namespace sandbox 448 } // namespace sandbox
OLDNEW
« no previous file with comments | « sandbox/linux/seccomp-bpf/sandbox_bpf_unittest.cc ('k') | sandbox/linux/tests/main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698