blob: efbf28b884d0a6b9738837bee508071b53e448ef [file] [log] [blame]
Victor Hsiehdbb86702020-06-15 09:29:07 -07001# This file is used to populate seccomp's allowlist policy in combination with SYSCALLS.TXT.
Paul Lawrence3dd3d552017-04-12 10:02:54 -07002# Note that the resultant policy is applied only to zygote spawned processes.
Paul Lawrence7ea40902017-02-14 13:32:23 -08003#
Victor Hsieh4f02dd52017-12-20 09:19:22 -08004# This file is processed by a python script named genseccomp.py.
Paul Lawrence7ea40902017-02-14 13:32:23 -08005
Elliott Hughesf9941702022-12-02 20:18:35 +00006# Syscalls needed to boot android
7int pivot_root(const char*, const char*) lp64
8int ioprio_get(int, int) lp64
9int ioprio_set(int, int, int) lp64
Paul Lawrence7ea40902017-02-14 13:32:23 -080010
Elliott Hughesf9941702022-12-02 20:18:35 +000011# Syscalls used internally by bionic, but not exposed directly.
12pid_t gettid() all
13int futex(int*, int, int, const timespec*, int*, int) all
14int clone(int (*)(void*), void*, int, void*, ...) all
15int sigreturn(unsigned long) lp32
16int rt_sigreturn(unsigned long) all
17int rt_tgsigqueueinfo(pid_t, pid_t, int, siginfo_t*) all
18int restart_syscall() all
Victor Hsieh1afb40c2018-03-30 16:48:36 +000019
Elliott Hughesf9941702022-12-02 20:18:35 +000020# vfork is used by bionic (and java.lang.ProcessBuilder) on some
21# architectures. (The others use clone(2) directly instead.)
22pid_t vfork() arm,x86,x86_64
Paul Lawrence7ea40902017-02-14 13:32:23 -080023
Elliott Hughesf9941702022-12-02 20:18:35 +000024# Needed for performance tools.
25int perf_event_open(perf_event_attr*, pid_t, int, int, unsigned long) all
Paul Lawrence7ea40902017-02-14 13:32:23 -080026
Elliott Hughesf9941702022-12-02 20:18:35 +000027# Needed for strace.
28int tkill(int, int) all
Paul Lawrence7ea40902017-02-14 13:32:23 -080029
Elliott Hughesf9941702022-12-02 20:18:35 +000030# Needed for a CTS test of seccomp (b/34763393).
31int seccomp(unsigned, unsigned, void*) all
32
Greg Kaiser6f027102022-12-13 17:20:04 +000033# TODO: remove these now we've updated the toolchain (http://b/229989971).
34int open(const char*, int, ...) arm,x86,x86_64
35int stat64(const char*, stat64*) arm,x86
36ssize_t readlink(const char*, char*, size_t) arm,x86,x86_64
37int stat(const char*, stat*) arm,x86,x86_64
38
Elliott Hughes9a5bdd62019-08-05 08:40:52 -070039#
Elliott Hughesf9941702022-12-02 20:18:35 +000040# (Potentially) useful new syscalls which we don't yet use in bionic.
Elliott Hughes9a5bdd62019-08-05 08:40:52 -070041#
42
Elliott Hughes9a5bdd62019-08-05 08:40:52 -070043# Since Linux 2.5, not in glibc.
Elliott Hughesf9941702022-12-02 20:18:35 +000044int io_setup(unsigned, aio_context_t*) all
45int io_destroy(aio_context_t) all
46int io_submit(aio_context_t, long, iocb**) all
47int io_getevents(aio_context_t, long, long, io_event*, timespec*) all
48int io_cancel(aio_context_t, iocb*, io_event*) all
Elliott Hughes3d24d2b2019-08-05 13:53:01 -070049# Since Linux 3.14, not in glibc.
Elliott Hughesf9941702022-12-02 20:18:35 +000050int sched_getattr(pid_t, sched_attr*, unsigned) all
51int sched_setattr(pid_t, sched_attr*, unsigned, unsigned) all
Elliott Hughes3d24d2b2019-08-05 13:53:01 -070052# Since Linux 3.19, not in glibc (and not really needed to implement fexecve).
Elliott Hughesf9941702022-12-02 20:18:35 +000053int execveat(int, const char*, char* const*, char* const*, int) all
Elliott Hughes3d24d2b2019-08-05 13:53:01 -070054# Since Linux 4.3, not in glibc. Probed for and conditionally used by ART.
Elliott Hughesf9941702022-12-02 20:18:35 +000055int membarrier(int, int) all
56# Since Linux 5.1, not in glibc. Not used by bionic, and not likely ever
57# to be (because the last thing anyone needs is a new 32-bit ABI in the
58# 2020s!) but http://b/138781460 showed cuttlefish needed at least the
59# clock_gettime64 syscall.
Elliott Hughesee7bc302019-07-31 18:39:00 -070060int clock_gettime64(clockid_t, timespec64*) lp32
61int clock_settime64(clockid_t, const timespec64*) lp32
62int clock_adjtime64(clockid_t, timex64*) lp32
63int clock_getres_time64(clockid_t, timespec64*) lp32
64int clock_nanosleep_time64(clockid_t, int, const timespec64*, timespec*) lp32
Elliott Hughesee7bc302019-07-31 18:39:00 -070065int timer_gettime64(__kernel_timer_t, itimerspec64*) lp32
66int timer_settime64(__kernel_timer_t, int, const itimerspec64*, itimerspec64*) lp32
67int timerfd_gettime64(int, itimerspec64*) lp32
68int timerfd_settime64(int, int, const itimerspec64*, itimerspec64*) lp32
69int utimensat_time64(int, const char*, const timespec64[2], int) lp32
70int pselect6_time64(int, fd_set*, fd_set*, timespec64*, void*) lp32
71int ppoll_time64(pollfd*, unsigned int, timespec64*, const sigset64_t*, size_t) lp32
72int recvmmsg_time64(int, mmsghdr*, unsigned int, int, const timespec64*) lp32
Elliott Hughesee7bc302019-07-31 18:39:00 -070073int rt_sigtimedwait_time64(const sigset64_t*, siginfo_t*, const timespec64*, size_t) lp32
74int futex_time64(int*, int, int, const timespec64*, int*, int) lp32
75int sched_rr_get_interval_time64(pid_t, timespec64*) lp32
Lokesh Gidra7839c172021-03-11 08:00:26 -080076# Since Linux 5.4, not in glibc. Probed for and conditionally used by ART.
77int userfaultfd(int) all