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

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

Issue 1613883002: Linux Sandbox: whitelist arm64 syscalls (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | no next file » | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/syscall_sets.h" 5 #include "sandbox/linux/seccomp-bpf-helpers/syscall_sets.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 #include "sandbox/linux/system_headers/linux_syscalls.h" 8 #include "sandbox/linux/system_headers/linux_syscalls.h"
9 9
10 namespace sandbox { 10 namespace sandbox {
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 return false; 407 return false;
408 } 408 }
409 } 409 }
410 410
411 bool SyscallSets::IsAllowedEpoll(int sysno) { 411 bool SyscallSets::IsAllowedEpoll(int sysno) {
412 switch (sysno) { 412 switch (sysno) {
413 #if !defined(__aarch64__) 413 #if !defined(__aarch64__)
414 case __NR_epoll_create: 414 case __NR_epoll_create:
415 case __NR_epoll_wait: 415 case __NR_epoll_wait:
416 #endif 416 #endif
417 case __NR_epoll_pwait:
jln (very slow on Chromium) 2016/01/27 00:19:17 Why does ARM64 influence this?
Riku Voipio 2016/01/27 15:37:27 The glibc function epoll_wait() will call epoll_pw
417 case __NR_epoll_create1: 418 case __NR_epoll_create1:
418 case __NR_epoll_ctl: 419 case __NR_epoll_ctl:
419 return true; 420 return true;
420 default: 421 default:
421 #if defined(__x86_64__) 422 #if defined(__x86_64__)
422 case __NR_epoll_ctl_old: 423 case __NR_epoll_ctl_old:
423 #endif 424 #endif
424 case __NR_epoll_pwait:
425 #if defined(__x86_64__) 425 #if defined(__x86_64__)
426 case __NR_epoll_wait_old: 426 case __NR_epoll_wait_old:
427 #endif 427 #endif
428 return false; 428 return false;
429 } 429 }
430 } 430 }
431 431
432 bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) { 432 bool SyscallSets::IsAllowedGetOrModifySocket(int sysno) {
433 switch (sysno) { 433 switch (sysno) {
434 #if !defined(__aarch64__) 434 #if !defined(__aarch64__)
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
599 default: 599 default:
600 return false; 600 return false;
601 } 601 }
602 } 602 }
603 603
604 bool SyscallSets::IsAllowedBasicScheduler(int sysno) { 604 bool SyscallSets::IsAllowedBasicScheduler(int sysno) {
605 switch (sysno) { 605 switch (sysno) {
606 case __NR_sched_yield: 606 case __NR_sched_yield:
607 #if !defined(__aarch64__) 607 #if !defined(__aarch64__)
608 case __NR_pause: 608 case __NR_pause:
609 #else
610 case __NR_getrlimit:
jln (very slow on Chromium) 2016/01/27 00:19:17 getrlimit is already somewhere else in this file.
Riku Voipio 2016/01/27 15:37:27 Thanks, this was the part of my patches I was most
Robert Sesek 2016/01/27 16:52:31 An alternative if we wanted to keep restricting ge
609 #endif 611 #endif
610 case __NR_nanosleep: 612 case __NR_nanosleep:
611 return true; 613 return true;
612 case __NR_getpriority: 614 case __NR_getpriority:
613 #if defined(__i386__) || defined(__arm__) || defined(__mips__) 615 #if defined(__i386__) || defined(__arm__) || defined(__mips__)
614 case __NR_nice: 616 case __NR_nice:
615 #endif 617 #endif
616 case __NR_setpriority: 618 case __NR_setpriority:
617 default: 619 default:
618 return false; 620 return false;
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
706 case __NR_mq_unlink: 708 case __NR_mq_unlink:
707 return true; 709 return true;
708 default: 710 default:
709 return false; 711 return false;
710 } 712 }
711 } 713 }
712 714
713 bool SyscallSets::IsGlobalProcessEnvironment(int sysno) { 715 bool SyscallSets::IsGlobalProcessEnvironment(int sysno) {
714 switch (sysno) { 716 switch (sysno) {
715 case __NR_acct: // Privileged. 717 case __NR_acct: // Privileged.
716 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__) || \ 718 #if defined(__i386__) || defined(__x86_64__) || defined(__mips__)
717 defined(__aarch64__)
718 case __NR_getrlimit: 719 case __NR_getrlimit:
719 #endif 720 #endif
720 #if defined(__i386__) || defined(__arm__) 721 #if defined(__i386__) || defined(__arm__)
721 case __NR_ugetrlimit: 722 case __NR_ugetrlimit:
722 #endif 723 #endif
723 #if defined(__i386__) || defined(__mips__) 724 #if defined(__i386__) || defined(__mips__)
724 case __NR_ulimit: 725 case __NR_ulimit:
725 #endif 726 #endif
726 case __NR_getrusage: 727 case __NR_getrusage:
727 case __NR_personality: // Can change its personality as well. 728 case __NR_personality: // Can change its personality as well.
(...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after
1051 switch (sysno) { 1052 switch (sysno) {
1052 case __NR_sysmips: 1053 case __NR_sysmips:
1053 case __NR_unused150: 1054 case __NR_unused150:
1054 return true; 1055 return true;
1055 default: 1056 default:
1056 return false; 1057 return false;
1057 } 1058 }
1058 } 1059 }
1059 #endif // defined(__mips__) 1060 #endif // defined(__mips__)
1060 } // namespace sandbox. 1061 } // namespace sandbox.
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698