Skip to content

Commit

Permalink
Disallow mount-related system calls
Browse files Browse the repository at this point in the history
These should be blocked by not having CAP_SYS_ADMIN, but better safe
than sorry.
  • Loading branch information
DemiMarie committed Dec 10, 2023
1 parent 5669531 commit 0a0241a
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions runtime/init-container/src/seccomp.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,7 @@ static const char *allow_syscalls[] = {
"flock",
"fork",
"fremovexattr",
"fsconfig",
"fsetxattr",
"fsmount",
"fsopen",
"fspick",
"fstat",
"fstat64",
"fstatat64",
Expand Down Expand Up @@ -189,9 +185,6 @@ static const char *allow_syscalls[] = {
"mlockall",
"mmap",
"mmap2",
"mount",
"mount_setattr",
"move_mount",
"mprotect",
"mq_getsetattr",
"mq_notify",
Expand Down Expand Up @@ -385,8 +378,6 @@ static const char *allow_syscalls[] = {
"truncate64",
"ugetrlimit",
"umask",
"umount",
"umount2",
"uname",
"unlink",
"unlinkat",
Expand Down Expand Up @@ -417,10 +408,19 @@ static const char *x86_syscalls[] = {

static const char *eperm_syscalls[] = {
"bdflush",
"bpf",
"fanotify_init",
"fsconfig",
"fsmount",
"fsopen",
"fspick",
"io_pgetevents",
"kexec_file_load",
"kexec_load",
"migrate_pages",
"mount",
"mount_setattr",
"move_mount",
"move_pages",
"nfsservctl",
"nice",
Expand All @@ -432,26 +432,26 @@ static const char *eperm_syscalls[] = {
"pciconfig_iobase",
"pciconfig_read",
"pciconfig_write",
"perf_event_open",
"quotactl",
"setdomainname",
"sethostname",
"setns",
"sgetmask",
"ssetmask",
"swapcontext",
"swapoff",
"swapon",
"sysfs",
"umount",
"umount2",
"unshare",
"uselib",
"userfaultfd",
"ustat",
"vm86",
"vm86old",
"vmsplice",
"bpf",
"fanotify_init",
"perf_event_open",
"quotactl",
"setdomainname",
"sethostname",
"setns",
"unshare",
};

#define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
Expand Down

0 comments on commit 0a0241a

Please sign in to comment.