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