blob: f14e11c51cfa8220744dc7af9391af33df629e51 [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.
Victor Hsieh2f23ced2018-01-17 16:59:12 -08002# Note that the resultant policy is applied only to zygote spawned processes.
3#
Victor Hsiehdbb86702020-06-15 09:29:07 -07004# The final seccomp allowlist is SYSCALLS.TXT - SECCOMP_BLOCKLIST.TXT + SECCOMP_ALLOWLIST.TXT
5# Any entry in the blocklist must be in the syscalls file and not be in the allowlist file
Victor Hsieh2f23ced2018-01-17 16:59:12 -08006#
Victor Hsieh2f23ced2018-01-17 16:59:12 -08007# This file is processed by a python script named genseccomp.py.
8
Victor Hsiehe15233c2018-03-28 16:30:20 -07009# Note: Some privileged syscalls are still needed in app process after fork before uid change,
Martijn Coenene17fce12019-01-21 14:29:35 +010010# including capset and setresuid. This is because the seccomp filter must be installed while
11# the process still has CAP_SYS_ADMIN; changing the uid would remove that capability.
Victor Hsiehe15233c2018-03-28 16:30:20 -070012
Victor Hsieh2f23ced2018-01-17 16:59:12 -080013# syscalls to modify IDs
Elliott Hughes2b499042020-02-13 14:21:55 -080014int setgid:setgid32(gid_t) lp32
15int setgid:setgid(gid_t) lp64
16int setuid:setuid32(uid_t) lp32
17int setuid:setuid(uid_t) lp64
18int setregid:setregid32(gid_t, gid_t) lp32
19int setregid:setregid(gid_t, gid_t) lp64
20int setreuid:setreuid32(uid_t, uid_t) lp32
21int setreuid:setreuid(uid_t, uid_t) lp64
22int setresgid:setresgid32(gid_t, gid_t, gid_t) lp32
23int setresgid:setresgid(gid_t, gid_t, gid_t) lp64
Martijn Coenene17fce12019-01-21 14:29:35 +010024# setresuid is explicitly allowed, see above.
Victor Hsieh2f23ced2018-01-17 16:59:12 -080025int setfsgid(gid_t) all
26int setfsuid(uid_t) all
Elliott Hughes2b499042020-02-13 14:21:55 -080027int setgroups:setgroups32(int, const gid_t*) lp32
28int setgroups:setgroups(int, const gid_t*) lp64
Victor Hsieh2f23ced2018-01-17 16:59:12 -080029
30# syscalls to modify times
31int adjtimex(struct timex*) all
32int clock_adjtime(clockid_t, struct timex*) all
33int clock_settime(clockid_t, const struct timespec*) all
34int settimeofday(const struct timeval*, const struct timezone*) all
35
36int acct(const char* filepath) all
37int klogctl:syslog(int, char*, int) all
Victor Hsieh2f23ced2018-01-17 16:59:12 -080038int chroot(const char*) all
39
40# syscalls to change machine various configurations
41int init_module(void*, unsigned long, const char*) all
42int delete_module(const char*, unsigned int) all
43int mount(const char*, const char*, const char*, unsigned long, const void*) all
44int umount2(const char*, int) all
45int swapon(const char*, int) all
46int swapoff(const char*) all
47int setdomainname(const char*, size_t) all
48int sethostname(const char*, size_t) all
49int __reboot:reboot(int, int, int, void*) all