Victor Hsieh | dbb8670 | 2020-06-15 09:29:07 -0700 | [diff] [blame] | 1 | # This file is used to populate seccomp's allowlist policy in combination with SYSCALLS.TXT. |
Paul Lawrence | 3dd3d55 | 2017-04-12 10:02:54 -0700 | [diff] [blame] | 2 | # Note that the resultant policy is applied only to zygote spawned processes. |
Paul Lawrence | 7ea4090 | 2017-02-14 13:32:23 -0800 | [diff] [blame] | 3 | # |
Victor Hsieh | 4f02dd5 | 2017-12-20 09:19:22 -0800 | [diff] [blame] | 4 | # This file is processed by a python script named genseccomp.py. |
Paul Lawrence | 7ea4090 | 2017-02-14 13:32:23 -0800 | [diff] [blame] | 5 | |
Elliott Hughes | f994170 | 2022-12-02 20:18:35 +0000 | [diff] [blame] | 6 | # Syscalls needed to boot android |
Elliott Hughes | 83f08aa | 2025-02-06 17:14:58 -0500 | [diff] [blame^] | 7 | pivot_root(const char*, const char*) lp64 |
| 8 | ioprio_get(int, int) lp64 |
| 9 | ioprio_set(int, int, int) lp64 |
Paul Lawrence | 7ea4090 | 2017-02-14 13:32:23 -0800 | [diff] [blame] | 10 | |
Elliott Hughes | f994170 | 2022-12-02 20:18:35 +0000 | [diff] [blame] | 11 | # Syscalls used internally by bionic, but not exposed directly. |
Elliott Hughes | 83f08aa | 2025-02-06 17:14:58 -0500 | [diff] [blame^] | 12 | gettid() all |
| 13 | futex(int*, int, int, const timespec*, int*, int) all |
| 14 | clone(int (*)(void*), void*, int, void*, ...) all |
| 15 | sigreturn(unsigned long) lp32 |
| 16 | rt_sigreturn(unsigned long) all |
| 17 | rt_tgsigqueueinfo(pid_t, pid_t, int, siginfo_t*) all |
| 18 | restart_syscall() all |
Victor Hsieh | 1afb40c | 2018-03-30 16:48:36 +0000 | [diff] [blame] | 19 | |
Elliott Hughes | fce8a15 | 2023-08-29 15:38:33 -0700 | [diff] [blame] | 20 | # The public API doesn't set errno, so we call this via inline assembler. |
Elliott Hughes | 83f08aa | 2025-02-06 17:14:58 -0500 | [diff] [blame^] | 21 | riscv_hwprobe(riscv_hwprobe*, size_t, size_t, unsigned long*, unsigned) riscv64 |
Elliott Hughes | fce8a15 | 2023-08-29 15:38:33 -0700 | [diff] [blame] | 22 | |
Elliott Hughes | f994170 | 2022-12-02 20:18:35 +0000 | [diff] [blame] | 23 | # vfork is used by bionic (and java.lang.ProcessBuilder) on some |
| 24 | # architectures. (The others use clone(2) directly instead.) |
Elliott Hughes | 83f08aa | 2025-02-06 17:14:58 -0500 | [diff] [blame^] | 25 | vfork() arm,x86,x86_64 |
Paul Lawrence | 7ea4090 | 2017-02-14 13:32:23 -0800 | [diff] [blame] | 26 | |
Elliott Hughes | f994170 | 2022-12-02 20:18:35 +0000 | [diff] [blame] | 27 | # Needed for performance tools. |
Elliott Hughes | 83f08aa | 2025-02-06 17:14:58 -0500 | [diff] [blame^] | 28 | perf_event_open(perf_event_attr*, pid_t, int, int, unsigned long) all |
Paul Lawrence | 7ea4090 | 2017-02-14 13:32:23 -0800 | [diff] [blame] | 29 | |
Elliott Hughes | f994170 | 2022-12-02 20:18:35 +0000 | [diff] [blame] | 30 | # Needed for strace. |
Elliott Hughes | 83f08aa | 2025-02-06 17:14:58 -0500 | [diff] [blame^] | 31 | tkill(int, int) all |
Paul Lawrence | 7ea4090 | 2017-02-14 13:32:23 -0800 | [diff] [blame] | 32 | |
Elliott Hughes | f994170 | 2022-12-02 20:18:35 +0000 | [diff] [blame] | 33 | # Needed for a CTS test of seccomp (b/34763393). |
Elliott Hughes | 83f08aa | 2025-02-06 17:14:58 -0500 | [diff] [blame^] | 34 | seccomp(unsigned, unsigned, void*) all |
Elliott Hughes | f994170 | 2022-12-02 20:18:35 +0000 | [diff] [blame] | 35 | |
Greg Kaiser | 6f02710 | 2022-12-13 17:20:04 +0000 | [diff] [blame] | 36 | # TODO: remove these now we've updated the toolchain (http://b/229989971). |
Elliott Hughes | 83f08aa | 2025-02-06 17:14:58 -0500 | [diff] [blame^] | 37 | open(const char*, int, ...) arm,x86,x86_64 |
| 38 | stat64(const char*, stat64*) arm,x86 |
| 39 | readlink(const char*, char*, size_t) arm,x86,x86_64 |
| 40 | stat(const char*, stat*) arm,x86,x86_64 |
Greg Kaiser | 6f02710 | 2022-12-13 17:20:04 +0000 | [diff] [blame] | 41 | |
Elliott Hughes | 9a5bdd6 | 2019-08-05 08:40:52 -0700 | [diff] [blame] | 42 | # |
Elliott Hughes | f994170 | 2022-12-02 20:18:35 +0000 | [diff] [blame] | 43 | # (Potentially) useful new syscalls which we don't yet use in bionic. |
Elliott Hughes | 9a5bdd6 | 2019-08-05 08:40:52 -0700 | [diff] [blame] | 44 | # |
| 45 | |
Elliott Hughes | 9a5bdd6 | 2019-08-05 08:40:52 -0700 | [diff] [blame] | 46 | # Since Linux 2.5, not in glibc. |
Elliott Hughes | 83f08aa | 2025-02-06 17:14:58 -0500 | [diff] [blame^] | 47 | io_setup(unsigned, aio_context_t*) all |
| 48 | io_destroy(aio_context_t) all |
| 49 | io_submit(aio_context_t, long, iocb**) all |
| 50 | io_getevents(aio_context_t, long, long, io_event*, timespec*) all |
| 51 | io_cancel(aio_context_t, iocb*, io_event*) all |
Elliott Hughes | 3d24d2b | 2019-08-05 13:53:01 -0700 | [diff] [blame] | 52 | # Since Linux 3.19, not in glibc (and not really needed to implement fexecve). |
Elliott Hughes | 83f08aa | 2025-02-06 17:14:58 -0500 | [diff] [blame^] | 53 | execveat(int, const char*, char* const*, char* const*, int) all |
Elliott Hughes | 3d24d2b | 2019-08-05 13:53:01 -0700 | [diff] [blame] | 54 | # Since Linux 4.3, not in glibc. Probed for and conditionally used by ART. |
Elliott Hughes | 83f08aa | 2025-02-06 17:14:58 -0500 | [diff] [blame^] | 55 | membarrier(int, int) all |
| 56 | userfaultfd(int) all |
Elliott Hughes | f994170 | 2022-12-02 20:18:35 +0000 | [diff] [blame] | 57 | # Since Linux 5.1, not in glibc. Not used by bionic, and not likely ever |
| 58 | # to be (because the last thing anyone needs is a new 32-bit ABI in the |
| 59 | # 2020s!) but http://b/138781460 showed cuttlefish needed at least the |
| 60 | # clock_gettime64 syscall. |
Elliott Hughes | 83f08aa | 2025-02-06 17:14:58 -0500 | [diff] [blame^] | 61 | clock_gettime64(clockid_t, timespec64*) lp32 |
| 62 | clock_settime64(clockid_t, const timespec64*) lp32 |
| 63 | clock_adjtime64(clockid_t, timex64*) lp32 |
| 64 | clock_getres_time64(clockid_t, timespec64*) lp32 |
| 65 | clock_nanosleep_time64(clockid_t, int, const timespec64*, timespec*) lp32 |
| 66 | timer_gettime64(__kernel_timer_t, itimerspec64*) lp32 |
| 67 | timer_settime64(__kernel_timer_t, int, const itimerspec64*, itimerspec64*) lp32 |
| 68 | timerfd_gettime64(int, itimerspec64*) lp32 |
| 69 | timerfd_settime64(int, int, const itimerspec64*, itimerspec64*) lp32 |
| 70 | utimensat_time64(int, const char*, const timespec64[2], int) lp32 |
| 71 | pselect6_time64(int, fd_set*, fd_set*, timespec64*, void*) lp32 |
| 72 | ppoll_time64(pollfd*, unsigned int, timespec64*, const sigset64_t*, size_t) lp32 |
| 73 | recvmmsg_time64(int, mmsghdr*, unsigned int, int, const timespec64*) lp32 |
| 74 | rt_sigtimedwait_time64(const sigset64_t*, siginfo_t*, const timespec64*, size_t) lp32 |
| 75 | futex_time64(int*, int, int, const timespec64*, int*, int) lp32 |
| 76 | sched_rr_get_interval_time64(pid_t, timespec64*) lp32 |
Elliott Hughes | b65dec5 | 2023-09-05 22:58:43 +0000 | [diff] [blame] | 77 | # Since Linux 5.3, not in glibc. Not used by bionic, but increasingly |
| 78 | # likely to be useful as new features are added. In particular, cgroups |
| 79 | # support seems potentially useful for Android (though the struct that |
| 80 | # changes size over time is obviously problematic). |
Elliott Hughes | 83f08aa | 2025-02-06 17:14:58 -0500 | [diff] [blame^] | 81 | clone3(clone_args*, size_t) all |