1# This file is used to populate seccomp's allowlist policy in combination with SYSCALLS.TXT. 2# Note that the resultant policy is applied only to zygote spawned processes. 3# 4# This file is processed by a python script named genseccomp.py. 5 6# Syscalls needed to boot android 7pivot_root(const char*, const char*) lp64 8ioprio_get(int, int) lp64 9ioprio_set(int, int, int) lp64 10 11# Syscalls used internally by bionic, but not exposed directly. 12gettid() all 13futex(int*, int, int, const timespec*, int*, int) all 14clone(int (*)(void*), void*, int, void*, ...) all 15sigreturn(unsigned long) lp32 16rt_sigreturn(unsigned long) all 17rt_tgsigqueueinfo(pid_t, pid_t, int, siginfo_t*) all 18restart_syscall() all 19 20# The public API doesn't set errno, so we call this via inline assembler. 21riscv_hwprobe(riscv_hwprobe*, size_t, size_t, unsigned long*, unsigned) riscv64 22 23# vfork is used by bionic (and java.lang.ProcessBuilder) on some 24# architectures. (The others use clone(2) directly instead.) 25vfork() arm,x86,x86_64 26 27# Needed for performance tools. 28perf_event_open(perf_event_attr*, pid_t, int, int, unsigned long) all 29 30# Needed for strace. 31tkill(int, int) all 32 33# Needed for a CTS test of seccomp (b/34763393). 34seccomp(unsigned, unsigned, void*) all 35 36# TODO: remove these now we've updated the toolchain (http://b/229989971). 37open(const char*, int, ...) arm,x86,x86_64 38stat64(const char*, stat64*) arm,x86 39readlink(const char*, char*, size_t) arm,x86,x86_64 40stat(const char*, stat*) arm,x86,x86_64 41 42# 43# (Potentially) useful new syscalls which we don't yet use in bionic. 44# 45 46# Since Linux 2.5, not in glibc. 47io_setup(unsigned, aio_context_t*) all 48io_destroy(aio_context_t) all 49io_submit(aio_context_t, long, iocb**) all 50io_getevents(aio_context_t, long, long, io_event*, timespec*) all 51io_cancel(aio_context_t, iocb*, io_event*) all 52# Since Linux 3.19, not in glibc (and not really needed to implement fexecve). 53execveat(int, const char*, char* const*, char* const*, int) all 54# Since Linux 4.3, not in glibc. Probed for and conditionally used by ART. 55membarrier(int, int) all 56userfaultfd(int) all 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. 61clock_gettime64(clockid_t, timespec64*) lp32 62clock_settime64(clockid_t, const timespec64*) lp32 63clock_adjtime64(clockid_t, timex64*) lp32 64clock_getres_time64(clockid_t, timespec64*) lp32 65clock_nanosleep_time64(clockid_t, int, const timespec64*, timespec*) lp32 66timer_gettime64(__kernel_timer_t, itimerspec64*) lp32 67timer_settime64(__kernel_timer_t, int, const itimerspec64*, itimerspec64*) lp32 68timerfd_gettime64(int, itimerspec64*) lp32 69timerfd_settime64(int, int, const itimerspec64*, itimerspec64*) lp32 70utimensat_time64(int, const char*, const timespec64[2], int) lp32 71pselect6_time64(int, fd_set*, fd_set*, timespec64*, void*) lp32 72ppoll_time64(pollfd*, unsigned int, timespec64*, const sigset64_t*, size_t) lp32 73recvmmsg_time64(int, mmsghdr*, unsigned int, int, const timespec64*) lp32 74rt_sigtimedwait_time64(const sigset64_t*, siginfo_t*, const timespec64*, size_t) lp32 75futex_time64(int*, int, int, const timespec64*, int*, int) lp32 76sched_rr_get_interval_time64(pid_t, timespec64*) lp32 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). 81clone3(clone_args*, size_t) all 82# Since 5.13, not in glibc. Probed for and conditionally used by 83# Chrome GPU processes. 84landlock_add_rule(int, uint64_t, const void*, uint32_t) all 85landlock_create_ruleset(const landlock_ruleset_attr*, size_t, uint64_t) all 86landlock_restrict_self(int, uint64_t) all 87