Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 <asm/unistd.h> | 5 #include <asm/unistd.h> |
| 6 #include <dlfcn.h> | 6 #include <dlfcn.h> |
| 7 #include <errno.h> | 7 #include <errno.h> |
| 8 #include <fcntl.h> | 8 #include <fcntl.h> |
| 9 #include <linux/audit.h> | 9 #include <linux/audit.h> |
| 10 #include <linux/filter.h> | 10 #include <linux/filter.h> |
| (...skipping 855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 866 case __NR_mq_unlink: | 866 case __NR_mq_unlink: |
| 867 return true; | 867 return true; |
| 868 default: | 868 default: |
| 869 return false; | 869 return false; |
| 870 } | 870 } |
| 871 } | 871 } |
| 872 | 872 |
| 873 bool IsGlobalProcessEnvironment(int sysno) { | 873 bool IsGlobalProcessEnvironment(int sysno) { |
| 874 switch (sysno) { | 874 switch (sysno) { |
| 875 case __NR_acct: // Privileged. | 875 case __NR_acct: // Privileged. |
| 876 #if defined(__i386__) || defined(__x86_64__) | |
|
jln (very slow on Chromium)
2013/05/29 03:36:40
There is no getrlimit on arm. I think this #ifdef
| |
| 877 case __NR_getrlimit: | 876 case __NR_getrlimit: |
| 878 #endif | |
| 879 #if defined(__i386__) || defined(__arm__) | 877 #if defined(__i386__) || defined(__arm__) |
| 880 case __NR_ugetrlimit: | 878 case __NR_ugetrlimit: |
| 881 #endif | 879 #endif |
| 882 #if defined(__i386__) | 880 #if defined(__i386__) |
| 883 case __NR_ulimit: | 881 case __NR_ulimit: |
| 884 #endif | 882 #endif |
| 885 case __NR_getrusage: | 883 case __NR_getrusage: |
| 886 case __NR_personality: // Can change its personality as well. | 884 case __NR_personality: // Can change its personality as well. |
| 887 case __NR_prlimit64: // Like setrlimit / getrlimit. | 885 case __NR_prlimit64: // Like setrlimit / getrlimit. |
| 888 case __NR_setrlimit: | 886 case __NR_setrlimit: |
| (...skipping 658 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1547 case __NR_clone: | 1545 case __NR_clone: |
| 1548 return RestrictCloneToThreadsAndEPERMFork(sandbox); | 1546 return RestrictCloneToThreadsAndEPERMFork(sandbox); |
| 1549 case __NR_ioctl: | 1547 case __NR_ioctl: |
| 1550 return RestrictIoctl(sandbox); | 1548 return RestrictIoctl(sandbox); |
| 1551 case __NR_prctl: | 1549 case __NR_prctl: |
| 1552 return RestrictPrctl(sandbox); | 1550 return RestrictPrctl(sandbox); |
| 1553 // Allow the system calls below. | 1551 // Allow the system calls below. |
| 1554 case __NR_fdatasync: | 1552 case __NR_fdatasync: |
| 1555 case __NR_fsync: | 1553 case __NR_fsync: |
| 1556 case __NR_getpriority: | 1554 case __NR_getpriority: |
| 1557 #if defined(__i386__) || defined(__x86_64__) | |
|
jln (very slow on Chromium)
2013/05/29 03:36:40
Ditto.
| |
| 1558 case __NR_getrlimit: | 1555 case __NR_getrlimit: |
| 1556 #if defined(__i386__) || defined(__arm__) | |
| 1557 case __NR_ugetrlimit: | |
| 1559 #endif | 1558 #endif |
| 1560 case __NR_mremap: // See crbug.com/149834. | 1559 case __NR_mremap: // See crbug.com/149834. |
| 1561 case __NR_pread64: | 1560 case __NR_pread64: |
| 1562 case __NR_pwrite64: | 1561 case __NR_pwrite64: |
| 1563 case __NR_sched_getaffinity: | 1562 case __NR_sched_getaffinity: |
| 1564 case __NR_sched_get_priority_max: | 1563 case __NR_sched_get_priority_max: |
| 1565 case __NR_sched_get_priority_min: | 1564 case __NR_sched_get_priority_min: |
| 1566 case __NR_sched_getparam: | 1565 case __NR_sched_getparam: |
| 1567 case __NR_sched_getscheduler: | 1566 case __NR_sched_getscheduler: |
| 1568 case __NR_sched_setscheduler: | 1567 case __NR_sched_setscheduler: |
| (...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1869 // should enable it, enable it or die. | 1868 // should enable it, enable it or die. |
| 1870 bool started_sandbox = StartBpfSandbox(command_line, process_type); | 1869 bool started_sandbox = StartBpfSandbox(command_line, process_type); |
| 1871 CHECK(started_sandbox); | 1870 CHECK(started_sandbox); |
| 1872 return true; | 1871 return true; |
| 1873 } | 1872 } |
| 1874 #endif | 1873 #endif |
| 1875 return false; | 1874 return false; |
| 1876 } | 1875 } |
| 1877 | 1876 |
| 1878 } // namespace content | 1877 } // namespace content |
| OLD | NEW |