2018-02-05 21:05:59 +00:00
|
|
|
package seccomp // import "github.com/docker/docker/profiles/seccomp"
|
2015-12-18 18:01:58 +00:00
|
|
|
|
2015-12-29 21:06:10 +00:00
|
|
|
import (
|
2020-09-18 16:49:38 +00:00
|
|
|
"github.com/opencontainers/runtime-spec/specs-go"
|
2017-05-23 14:22:32 +00:00
|
|
|
"golang.org/x/sys/unix"
|
2015-12-29 21:06:10 +00:00
|
|
|
)
|
2015-12-18 18:01:58 +00:00
|
|
|
|
2020-09-18 16:14:16 +00:00
|
|
|
func arches() []Architecture {
|
|
|
|
return []Architecture{
|
2015-12-18 18:01:58 +00:00
|
|
|
{
|
2020-09-18 16:49:38 +00:00
|
|
|
Arch: specs.ArchX86_64,
|
|
|
|
SubArches: []specs.Arch{specs.ArchX86, specs.ArchX32},
|
2015-12-18 18:01:58 +00:00
|
|
|
},
|
|
|
|
{
|
2020-09-18 16:49:38 +00:00
|
|
|
Arch: specs.ArchAARCH64,
|
|
|
|
SubArches: []specs.Arch{specs.ArchARM},
|
2015-12-18 18:01:58 +00:00
|
|
|
},
|
2015-12-29 17:28:30 +00:00
|
|
|
{
|
2020-09-18 16:49:38 +00:00
|
|
|
Arch: specs.ArchMIPS64,
|
|
|
|
SubArches: []specs.Arch{specs.ArchMIPS, specs.ArchMIPS64N32},
|
2015-12-29 17:28:30 +00:00
|
|
|
},
|
2015-12-29 12:48:16 +00:00
|
|
|
{
|
2020-09-18 16:49:38 +00:00
|
|
|
Arch: specs.ArchMIPS64N32,
|
|
|
|
SubArches: []specs.Arch{specs.ArchMIPS, specs.ArchMIPS64},
|
2015-12-29 12:48:16 +00:00
|
|
|
},
|
2015-12-18 18:01:58 +00:00
|
|
|
{
|
2020-09-18 16:49:38 +00:00
|
|
|
Arch: specs.ArchMIPSEL64,
|
|
|
|
SubArches: []specs.Arch{specs.ArchMIPSEL, specs.ArchMIPSEL64N32},
|
2015-12-29 21:06:10 +00:00
|
|
|
},
|
2016-05-25 19:49:30 +00:00
|
|
|
{
|
2020-09-18 16:49:38 +00:00
|
|
|
Arch: specs.ArchMIPSEL64N32,
|
|
|
|
SubArches: []specs.Arch{specs.ArchMIPSEL, specs.ArchMIPSEL64},
|
2016-05-25 19:49:30 +00:00
|
|
|
},
|
|
|
|
{
|
2020-09-18 16:49:38 +00:00
|
|
|
Arch: specs.ArchS390X,
|
|
|
|
SubArches: []specs.Arch{specs.ArchS390},
|
2016-05-25 19:49:30 +00:00
|
|
|
},
|
2022-05-02 08:08:56 +00:00
|
|
|
{
|
|
|
|
Arch: specs.ArchRISCV64,
|
|
|
|
SubArches: nil,
|
|
|
|
},
|
2016-07-13 13:41:30 +00:00
|
|
|
}
|
|
|
|
}
|
2016-05-25 19:49:30 +00:00
|
|
|
|
2020-07-14 08:41:34 +00:00
|
|
|
// DefaultProfile defines the allowed syscalls for the default seccomp profile.
|
2020-09-18 16:14:16 +00:00
|
|
|
func DefaultProfile() *Seccomp {
|
2021-07-26 18:10:01 +00:00
|
|
|
nosys := uint(unix.ENOSYS)
|
2020-09-18 16:14:16 +00:00
|
|
|
syscalls := []*Syscall{
|
2015-12-29 21:06:10 +00:00
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"accept",
|
|
|
|
"accept4",
|
|
|
|
"access",
|
|
|
|
"adjtimex",
|
|
|
|
"alarm",
|
|
|
|
"bind",
|
|
|
|
"brk",
|
2024-02-06 12:57:00 +00:00
|
|
|
"cachestat", // kernel v6.5, libseccomp v2.5.5
|
2021-02-09 13:30:14 +00:00
|
|
|
"capget",
|
|
|
|
"capset",
|
|
|
|
"chdir",
|
|
|
|
"chmod",
|
|
|
|
"chown",
|
|
|
|
"chown32",
|
|
|
|
"clock_adjtime",
|
|
|
|
"clock_adjtime64",
|
|
|
|
"clock_getres",
|
|
|
|
"clock_getres_time64",
|
|
|
|
"clock_gettime",
|
|
|
|
"clock_gettime64",
|
|
|
|
"clock_nanosleep",
|
|
|
|
"clock_nanosleep_time64",
|
|
|
|
"close",
|
|
|
|
"close_range",
|
|
|
|
"connect",
|
|
|
|
"copy_file_range",
|
|
|
|
"creat",
|
|
|
|
"dup",
|
|
|
|
"dup2",
|
|
|
|
"dup3",
|
|
|
|
"epoll_create",
|
|
|
|
"epoll_create1",
|
|
|
|
"epoll_ctl",
|
|
|
|
"epoll_ctl_old",
|
|
|
|
"epoll_pwait",
|
|
|
|
"epoll_pwait2",
|
|
|
|
"epoll_wait",
|
|
|
|
"epoll_wait_old",
|
|
|
|
"eventfd",
|
|
|
|
"eventfd2",
|
|
|
|
"execve",
|
|
|
|
"execveat",
|
|
|
|
"exit",
|
|
|
|
"exit_group",
|
|
|
|
"faccessat",
|
|
|
|
"faccessat2",
|
|
|
|
"fadvise64",
|
|
|
|
"fadvise64_64",
|
|
|
|
"fallocate",
|
|
|
|
"fanotify_mark",
|
|
|
|
"fchdir",
|
|
|
|
"fchmod",
|
|
|
|
"fchmodat",
|
2024-02-06 12:59:04 +00:00
|
|
|
"fchmodat2", // kernel v6.6, libseccomp v2.5.5
|
2021-02-09 13:30:14 +00:00
|
|
|
"fchown",
|
|
|
|
"fchown32",
|
|
|
|
"fchownat",
|
|
|
|
"fcntl",
|
|
|
|
"fcntl64",
|
|
|
|
"fdatasync",
|
|
|
|
"fgetxattr",
|
|
|
|
"flistxattr",
|
|
|
|
"flock",
|
|
|
|
"fork",
|
|
|
|
"fremovexattr",
|
|
|
|
"fsetxattr",
|
|
|
|
"fstat",
|
|
|
|
"fstat64",
|
|
|
|
"fstatat64",
|
|
|
|
"fstatfs",
|
|
|
|
"fstatfs64",
|
|
|
|
"fsync",
|
|
|
|
"ftruncate",
|
|
|
|
"ftruncate64",
|
|
|
|
"futex",
|
2024-02-06 13:12:31 +00:00
|
|
|
"futex_requeue", // kernel v6.7, libseccomp v2.5.5
|
2021-02-09 13:30:14 +00:00
|
|
|
"futex_time64",
|
2024-02-06 13:09:57 +00:00
|
|
|
"futex_wait", // kernel v6.7, libseccomp v2.5.5
|
2022-05-13 09:20:48 +00:00
|
|
|
"futex_waitv",
|
2024-02-06 13:06:07 +00:00
|
|
|
"futex_wake", // kernel v6.7, libseccomp v2.5.5
|
2021-02-09 13:30:14 +00:00
|
|
|
"futimesat",
|
|
|
|
"getcpu",
|
|
|
|
"getcwd",
|
|
|
|
"getdents",
|
|
|
|
"getdents64",
|
|
|
|
"getegid",
|
|
|
|
"getegid32",
|
|
|
|
"geteuid",
|
|
|
|
"geteuid32",
|
|
|
|
"getgid",
|
|
|
|
"getgid32",
|
|
|
|
"getgroups",
|
|
|
|
"getgroups32",
|
|
|
|
"getitimer",
|
|
|
|
"getpeername",
|
|
|
|
"getpgid",
|
|
|
|
"getpgrp",
|
|
|
|
"getpid",
|
|
|
|
"getppid",
|
|
|
|
"getpriority",
|
|
|
|
"getrandom",
|
|
|
|
"getresgid",
|
|
|
|
"getresgid32",
|
|
|
|
"getresuid",
|
|
|
|
"getresuid32",
|
|
|
|
"getrlimit",
|
|
|
|
"get_robust_list",
|
|
|
|
"getrusage",
|
|
|
|
"getsid",
|
|
|
|
"getsockname",
|
|
|
|
"getsockopt",
|
|
|
|
"get_thread_area",
|
|
|
|
"gettid",
|
|
|
|
"gettimeofday",
|
|
|
|
"getuid",
|
|
|
|
"getuid32",
|
|
|
|
"getxattr",
|
|
|
|
"inotify_add_watch",
|
|
|
|
"inotify_init",
|
|
|
|
"inotify_init1",
|
|
|
|
"inotify_rm_watch",
|
|
|
|
"io_cancel",
|
|
|
|
"ioctl",
|
|
|
|
"io_destroy",
|
|
|
|
"io_getevents",
|
|
|
|
"io_pgetevents",
|
|
|
|
"io_pgetevents_time64",
|
|
|
|
"ioprio_get",
|
|
|
|
"ioprio_set",
|
|
|
|
"io_setup",
|
|
|
|
"io_submit",
|
|
|
|
"ipc",
|
|
|
|
"kill",
|
2022-01-30 18:08:46 +00:00
|
|
|
"landlock_add_rule",
|
|
|
|
"landlock_create_ruleset",
|
|
|
|
"landlock_restrict_self",
|
2021-02-09 13:30:14 +00:00
|
|
|
"lchown",
|
|
|
|
"lchown32",
|
|
|
|
"lgetxattr",
|
|
|
|
"link",
|
|
|
|
"linkat",
|
|
|
|
"listen",
|
|
|
|
"listxattr",
|
|
|
|
"llistxattr",
|
|
|
|
"_llseek",
|
|
|
|
"lremovexattr",
|
|
|
|
"lseek",
|
|
|
|
"lsetxattr",
|
|
|
|
"lstat",
|
|
|
|
"lstat64",
|
|
|
|
"madvise",
|
2024-02-06 13:02:33 +00:00
|
|
|
"map_shadow_stack", // kernel v6.6, libseccomp v2.5.5
|
2021-02-09 13:30:14 +00:00
|
|
|
"membarrier",
|
|
|
|
"memfd_create",
|
2022-05-13 09:20:48 +00:00
|
|
|
"memfd_secret",
|
2021-02-09 13:30:14 +00:00
|
|
|
"mincore",
|
|
|
|
"mkdir",
|
|
|
|
"mkdirat",
|
|
|
|
"mknod",
|
|
|
|
"mknodat",
|
|
|
|
"mlock",
|
|
|
|
"mlock2",
|
|
|
|
"mlockall",
|
|
|
|
"mmap",
|
|
|
|
"mmap2",
|
|
|
|
"mprotect",
|
|
|
|
"mq_getsetattr",
|
|
|
|
"mq_notify",
|
|
|
|
"mq_open",
|
|
|
|
"mq_timedreceive",
|
|
|
|
"mq_timedreceive_time64",
|
|
|
|
"mq_timedsend",
|
|
|
|
"mq_timedsend_time64",
|
|
|
|
"mq_unlink",
|
|
|
|
"mremap",
|
|
|
|
"msgctl",
|
|
|
|
"msgget",
|
|
|
|
"msgrcv",
|
|
|
|
"msgsnd",
|
|
|
|
"msync",
|
|
|
|
"munlock",
|
|
|
|
"munlockall",
|
|
|
|
"munmap",
|
2023-06-28 11:43:22 +00:00
|
|
|
"name_to_handle_at",
|
2021-02-09 13:30:14 +00:00
|
|
|
"nanosleep",
|
|
|
|
"newfstatat",
|
|
|
|
"_newselect",
|
|
|
|
"open",
|
|
|
|
"openat",
|
|
|
|
"openat2",
|
|
|
|
"pause",
|
|
|
|
"pidfd_open",
|
|
|
|
"pidfd_send_signal",
|
|
|
|
"pipe",
|
|
|
|
"pipe2",
|
2022-04-15 03:29:11 +00:00
|
|
|
"pkey_alloc",
|
|
|
|
"pkey_free",
|
|
|
|
"pkey_mprotect",
|
2021-02-09 13:30:14 +00:00
|
|
|
"poll",
|
|
|
|
"ppoll",
|
|
|
|
"ppoll_time64",
|
|
|
|
"prctl",
|
|
|
|
"pread64",
|
|
|
|
"preadv",
|
|
|
|
"preadv2",
|
|
|
|
"prlimit64",
|
2022-05-13 09:20:48 +00:00
|
|
|
"process_mrelease",
|
2021-02-09 13:30:14 +00:00
|
|
|
"pselect6",
|
|
|
|
"pselect6_time64",
|
|
|
|
"pwrite64",
|
|
|
|
"pwritev",
|
|
|
|
"pwritev2",
|
|
|
|
"read",
|
|
|
|
"readahead",
|
|
|
|
"readlink",
|
|
|
|
"readlinkat",
|
|
|
|
"readv",
|
|
|
|
"recv",
|
|
|
|
"recvfrom",
|
|
|
|
"recvmmsg",
|
|
|
|
"recvmmsg_time64",
|
|
|
|
"recvmsg",
|
|
|
|
"remap_file_pages",
|
|
|
|
"removexattr",
|
|
|
|
"rename",
|
|
|
|
"renameat",
|
|
|
|
"renameat2",
|
|
|
|
"restart_syscall",
|
|
|
|
"rmdir",
|
|
|
|
"rseq",
|
|
|
|
"rt_sigaction",
|
|
|
|
"rt_sigpending",
|
|
|
|
"rt_sigprocmask",
|
|
|
|
"rt_sigqueueinfo",
|
|
|
|
"rt_sigreturn",
|
|
|
|
"rt_sigsuspend",
|
|
|
|
"rt_sigtimedwait",
|
|
|
|
"rt_sigtimedwait_time64",
|
|
|
|
"rt_tgsigqueueinfo",
|
|
|
|
"sched_getaffinity",
|
|
|
|
"sched_getattr",
|
|
|
|
"sched_getparam",
|
|
|
|
"sched_get_priority_max",
|
|
|
|
"sched_get_priority_min",
|
|
|
|
"sched_getscheduler",
|
|
|
|
"sched_rr_get_interval",
|
|
|
|
"sched_rr_get_interval_time64",
|
|
|
|
"sched_setaffinity",
|
|
|
|
"sched_setattr",
|
|
|
|
"sched_setparam",
|
|
|
|
"sched_setscheduler",
|
|
|
|
"sched_yield",
|
|
|
|
"seccomp",
|
|
|
|
"select",
|
|
|
|
"semctl",
|
|
|
|
"semget",
|
|
|
|
"semop",
|
|
|
|
"semtimedop",
|
|
|
|
"semtimedop_time64",
|
|
|
|
"send",
|
|
|
|
"sendfile",
|
|
|
|
"sendfile64",
|
|
|
|
"sendmmsg",
|
|
|
|
"sendmsg",
|
|
|
|
"sendto",
|
|
|
|
"setfsgid",
|
|
|
|
"setfsgid32",
|
|
|
|
"setfsuid",
|
|
|
|
"setfsuid32",
|
|
|
|
"setgid",
|
|
|
|
"setgid32",
|
|
|
|
"setgroups",
|
|
|
|
"setgroups32",
|
|
|
|
"setitimer",
|
|
|
|
"setpgid",
|
|
|
|
"setpriority",
|
|
|
|
"setregid",
|
|
|
|
"setregid32",
|
|
|
|
"setresgid",
|
|
|
|
"setresgid32",
|
|
|
|
"setresuid",
|
|
|
|
"setresuid32",
|
|
|
|
"setreuid",
|
|
|
|
"setreuid32",
|
|
|
|
"setrlimit",
|
|
|
|
"set_robust_list",
|
|
|
|
"setsid",
|
|
|
|
"setsockopt",
|
|
|
|
"set_thread_area",
|
|
|
|
"set_tid_address",
|
|
|
|
"setuid",
|
|
|
|
"setuid32",
|
|
|
|
"setxattr",
|
|
|
|
"shmat",
|
|
|
|
"shmctl",
|
|
|
|
"shmdt",
|
|
|
|
"shmget",
|
|
|
|
"shutdown",
|
|
|
|
"sigaltstack",
|
|
|
|
"signalfd",
|
|
|
|
"signalfd4",
|
|
|
|
"sigprocmask",
|
|
|
|
"sigreturn",
|
|
|
|
"socketcall",
|
|
|
|
"socketpair",
|
|
|
|
"splice",
|
|
|
|
"stat",
|
|
|
|
"stat64",
|
|
|
|
"statfs",
|
|
|
|
"statfs64",
|
|
|
|
"statx",
|
|
|
|
"symlink",
|
|
|
|
"symlinkat",
|
|
|
|
"sync",
|
|
|
|
"sync_file_range",
|
|
|
|
"syncfs",
|
|
|
|
"sysinfo",
|
|
|
|
"tee",
|
|
|
|
"tgkill",
|
|
|
|
"time",
|
|
|
|
"timer_create",
|
|
|
|
"timer_delete",
|
|
|
|
"timer_getoverrun",
|
|
|
|
"timer_gettime",
|
|
|
|
"timer_gettime64",
|
|
|
|
"timer_settime",
|
|
|
|
"timer_settime64",
|
|
|
|
"timerfd_create",
|
|
|
|
"timerfd_gettime",
|
|
|
|
"timerfd_gettime64",
|
|
|
|
"timerfd_settime",
|
|
|
|
"timerfd_settime64",
|
|
|
|
"times",
|
|
|
|
"tkill",
|
|
|
|
"truncate",
|
|
|
|
"truncate64",
|
|
|
|
"ugetrlimit",
|
|
|
|
"umask",
|
|
|
|
"uname",
|
|
|
|
"unlink",
|
|
|
|
"unlinkat",
|
|
|
|
"utime",
|
|
|
|
"utimensat",
|
|
|
|
"utimensat_time64",
|
|
|
|
"utimes",
|
|
|
|
"vfork",
|
|
|
|
"vmsplice",
|
|
|
|
"wait4",
|
|
|
|
"waitid",
|
|
|
|
"waitpid",
|
|
|
|
"write",
|
|
|
|
"writev",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"process_vm_readv",
|
|
|
|
"process_vm_writev",
|
|
|
|
"ptrace",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2020-10-01 10:26:46 +00:00
|
|
|
MinKernel: &KernelVersion{4, 8},
|
2018-11-03 04:00:15 +00:00
|
|
|
},
|
|
|
|
},
|
2022-12-01 13:06:37 +00:00
|
|
|
{
|
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{"socket"},
|
|
|
|
Action: specs.ActAllow,
|
|
|
|
Args: []specs.LinuxSeccompArg{
|
|
|
|
{
|
|
|
|
Index: 0,
|
|
|
|
Value: unix.AF_VSOCK,
|
|
|
|
Op: specs.OpNotEqual,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2015-12-18 18:01:58 +00:00
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{"personality"},
|
|
|
|
Action: specs.ActAllow,
|
|
|
|
Args: []specs.LinuxSeccompArg{
|
|
|
|
{
|
|
|
|
Index: 0,
|
|
|
|
Value: 0x0,
|
|
|
|
Op: specs.OpEqualTo,
|
|
|
|
},
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
|
|
|
},
|
2015-12-18 18:01:58 +00:00
|
|
|
},
|
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{"personality"},
|
|
|
|
Action: specs.ActAllow,
|
|
|
|
Args: []specs.LinuxSeccompArg{
|
|
|
|
{
|
|
|
|
Index: 0,
|
|
|
|
Value: 0x0008,
|
|
|
|
Op: specs.OpEqualTo,
|
|
|
|
},
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
|
|
|
},
|
2015-12-18 18:01:58 +00:00
|
|
|
},
|
2017-05-02 14:05:01 +00:00
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{"personality"},
|
|
|
|
Action: specs.ActAllow,
|
|
|
|
Args: []specs.LinuxSeccompArg{
|
|
|
|
{
|
|
|
|
Index: 0,
|
|
|
|
Value: 0x20000,
|
|
|
|
Op: specs.OpEqualTo,
|
|
|
|
},
|
2017-05-02 14:05:01 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{"personality"},
|
|
|
|
Action: specs.ActAllow,
|
|
|
|
Args: []specs.LinuxSeccompArg{
|
|
|
|
{
|
|
|
|
Index: 0,
|
|
|
|
Value: 0x20008,
|
|
|
|
Op: specs.OpEqualTo,
|
|
|
|
},
|
2017-05-02 14:05:01 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2015-12-18 18:01:58 +00:00
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{"personality"},
|
|
|
|
Action: specs.ActAllow,
|
|
|
|
Args: []specs.LinuxSeccompArg{
|
|
|
|
{
|
|
|
|
Index: 0,
|
|
|
|
Value: 0xffffffff,
|
|
|
|
Op: specs.OpEqualTo,
|
|
|
|
},
|
2016-12-02 16:41:26 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2017-02-13 12:55:53 +00:00
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"sync_file_range2",
|
2021-12-18 13:06:07 +00:00
|
|
|
"swapcontext",
|
2021-02-09 13:30:14 +00:00
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
2017-02-13 12:55:53 +00:00
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2017-02-13 12:55:53 +00:00
|
|
|
Arches: []string{"ppc64le"},
|
|
|
|
},
|
|
|
|
},
|
2015-12-18 18:01:58 +00:00
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"arm_fadvise64_64",
|
|
|
|
"arm_sync_file_range",
|
|
|
|
"sync_file_range2",
|
|
|
|
"breakpoint",
|
|
|
|
"cacheflush",
|
|
|
|
"set_tls",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Arches: []string{"arm", "arm64"},
|
|
|
|
},
|
2015-12-29 21:06:10 +00:00
|
|
|
},
|
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"arch_prctl",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Arches: []string{"amd64", "x32"},
|
|
|
|
},
|
2015-12-29 21:06:10 +00:00
|
|
|
},
|
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"modify_ldt",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Arches: []string{"amd64", "x32", "x86"},
|
|
|
|
},
|
2015-12-29 21:06:10 +00:00
|
|
|
},
|
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"s390_pci_mmio_read",
|
|
|
|
"s390_pci_mmio_write",
|
|
|
|
"s390_runtime_instr",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Arches: []string{"s390", "s390x"},
|
|
|
|
},
|
2015-12-29 21:06:10 +00:00
|
|
|
},
|
2022-05-02 08:08:56 +00:00
|
|
|
{
|
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"riscv_flush_icache",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
|
|
|
},
|
|
|
|
Includes: &Filter{
|
|
|
|
Arches: []string{"riscv64"},
|
|
|
|
},
|
|
|
|
},
|
2015-12-29 21:06:10 +00:00
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"open_by_handle_at",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Caps: []string{"CAP_DAC_READ_SEARCH"},
|
|
|
|
},
|
2015-12-29 21:06:10 +00:00
|
|
|
},
|
2015-12-29 21:48:31 +00:00
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"bpf",
|
|
|
|
"clone",
|
2021-07-26 18:10:01 +00:00
|
|
|
"clone3",
|
2021-02-09 13:30:14 +00:00
|
|
|
"fanotify_init",
|
|
|
|
"fsconfig",
|
|
|
|
"fsmount",
|
|
|
|
"fsopen",
|
|
|
|
"fspick",
|
|
|
|
"lookup_dcookie",
|
|
|
|
"mount",
|
2022-05-13 09:20:48 +00:00
|
|
|
"mount_setattr",
|
2021-02-09 13:30:14 +00:00
|
|
|
"move_mount",
|
|
|
|
"open_tree",
|
|
|
|
"perf_event_open",
|
|
|
|
"quotactl",
|
2022-05-13 09:20:48 +00:00
|
|
|
"quotactl_fd",
|
2021-02-09 13:30:14 +00:00
|
|
|
"setdomainname",
|
|
|
|
"sethostname",
|
|
|
|
"setns",
|
|
|
|
"syslog",
|
|
|
|
"umount",
|
|
|
|
"umount2",
|
|
|
|
"unshare",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Caps: []string{"CAP_SYS_ADMIN"},
|
|
|
|
},
|
2015-12-29 21:48:31 +00:00
|
|
|
},
|
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"clone",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
|
|
|
Args: []specs.LinuxSeccompArg{
|
|
|
|
{
|
|
|
|
Index: 0,
|
|
|
|
Value: unix.CLONE_NEWNS | unix.CLONE_NEWUTS | unix.CLONE_NEWIPC | unix.CLONE_NEWUSER | unix.CLONE_NEWPID | unix.CLONE_NEWNET | unix.CLONE_NEWCGROUP,
|
|
|
|
ValueTwo: 0,
|
|
|
|
Op: specs.OpMaskedEqual,
|
|
|
|
},
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Excludes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Caps: []string{"CAP_SYS_ADMIN"},
|
|
|
|
Arches: []string{"s390", "s390x"},
|
|
|
|
},
|
2015-12-29 21:48:31 +00:00
|
|
|
},
|
2015-12-29 21:06:10 +00:00
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"clone",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
|
|
|
Args: []specs.LinuxSeccompArg{
|
|
|
|
{
|
|
|
|
Index: 1,
|
|
|
|
Value: unix.CLONE_NEWNS | unix.CLONE_NEWUTS | unix.CLONE_NEWIPC | unix.CLONE_NEWUSER | unix.CLONE_NEWPID | unix.CLONE_NEWNET | unix.CLONE_NEWCGROUP,
|
|
|
|
ValueTwo: 0,
|
|
|
|
Op: specs.OpMaskedEqual,
|
|
|
|
},
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
|
|
|
},
|
|
|
|
Comment: "s390 parameter ordering for clone is different",
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Arches: []string{"s390", "s390x"},
|
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Excludes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Caps: []string{"CAP_SYS_ADMIN"},
|
|
|
|
},
|
2015-12-29 21:06:10 +00:00
|
|
|
},
|
2021-07-26 18:10:01 +00:00
|
|
|
{
|
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"clone3",
|
|
|
|
},
|
|
|
|
Action: specs.ActErrno,
|
|
|
|
ErrnoRet: &nosys,
|
|
|
|
},
|
|
|
|
Excludes: &Filter{
|
|
|
|
Caps: []string{"CAP_SYS_ADMIN"},
|
|
|
|
},
|
|
|
|
},
|
2015-12-29 21:48:31 +00:00
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"reboot",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Caps: []string{"CAP_SYS_BOOT"},
|
|
|
|
},
|
2015-12-29 21:48:31 +00:00
|
|
|
},
|
2015-12-29 21:06:10 +00:00
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"chroot",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Caps: []string{"CAP_SYS_CHROOT"},
|
|
|
|
},
|
2015-12-29 21:06:10 +00:00
|
|
|
},
|
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"delete_module",
|
|
|
|
"init_module",
|
|
|
|
"finit_module",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Caps: []string{"CAP_SYS_MODULE"},
|
|
|
|
},
|
2015-12-29 21:06:10 +00:00
|
|
|
},
|
2015-12-29 21:48:31 +00:00
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"acct",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Caps: []string{"CAP_SYS_PACCT"},
|
|
|
|
},
|
2015-12-29 21:48:31 +00:00
|
|
|
},
|
2015-12-29 21:06:10 +00:00
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"kcmp",
|
|
|
|
"pidfd_getfd",
|
|
|
|
"process_madvise",
|
|
|
|
"process_vm_readv",
|
|
|
|
"process_vm_writev",
|
|
|
|
"ptrace",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Caps: []string{"CAP_SYS_PTRACE"},
|
|
|
|
},
|
2015-12-29 21:06:10 +00:00
|
|
|
},
|
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"iopl",
|
|
|
|
"ioperm",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Caps: []string{"CAP_SYS_RAWIO"},
|
|
|
|
},
|
2015-12-29 21:06:10 +00:00
|
|
|
},
|
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"settimeofday",
|
|
|
|
"stime",
|
|
|
|
"clock_settime",
|
2022-07-06 21:45:13 +00:00
|
|
|
"clock_settime64",
|
2021-02-09 13:30:14 +00:00
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Caps: []string{"CAP_SYS_TIME"},
|
|
|
|
},
|
2015-12-29 21:06:10 +00:00
|
|
|
},
|
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"vhangup",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
2016-07-13 13:41:30 +00:00
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2016-07-13 13:41:30 +00:00
|
|
|
Caps: []string{"CAP_SYS_TTY_CONFIG"},
|
|
|
|
},
|
2015-12-29 21:06:10 +00:00
|
|
|
},
|
2018-06-08 15:41:48 +00:00
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"get_mempolicy",
|
|
|
|
"mbind",
|
|
|
|
"set_mempolicy",
|
seccomp: add set_mempolicy_home_node syscall (kernel v5.17, libseccomp v2.5.4)
This syscall is gated by CAP_SYS_NICE, matching the profile in containerd.
containerd: https://github.com/containerd/containerd/commit/a6e52c74fa043a63d7dae4ac6998215f6c1bb6ac
libseccomp: https://github.com/seccomp/libseccomp/commit/d83cb7ac252db91e9ca9c372ea4743e02ba97c50
kernel: https://github.com/torvalds/linux/commit/c6018b4b254971863bd0ad36bb5e7d0fa0f0ddb0
mm/mempolicy: add set_mempolicy_home_node syscall
This syscall can be used to set a home node for the MPOL_BIND and
MPOL_PREFERRED_MANY memory policy. Users should use this syscall after
setting up a memory policy for the specified range as shown below.
mbind(p, nr_pages * page_size, MPOL_BIND, new_nodes->maskp,
new_nodes->size + 1, 0);
sys_set_mempolicy_home_node((unsigned long)p, nr_pages * page_size,
home_node, 0);
The syscall allows specifying a home node/preferred node from which
kernel will fulfill memory allocation requests first.
...
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2024-02-06 12:20:39 +00:00
|
|
|
"set_mempolicy_home_node", // kernel v5.17, libseccomp v2.5.4
|
2021-02-09 13:30:14 +00:00
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
2018-06-08 15:41:48 +00:00
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2018-06-08 15:41:48 +00:00
|
|
|
Caps: []string{"CAP_SYS_NICE"},
|
|
|
|
},
|
|
|
|
},
|
2018-09-27 21:27:05 +00:00
|
|
|
{
|
2021-02-09 13:30:14 +00:00
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"syslog",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
2018-09-27 21:27:05 +00:00
|
|
|
},
|
2021-02-09 13:46:50 +00:00
|
|
|
Includes: &Filter{
|
2018-09-27 21:27:05 +00:00
|
|
|
Caps: []string{"CAP_SYSLOG"},
|
|
|
|
},
|
|
|
|
},
|
2022-08-18 16:34:09 +00:00
|
|
|
{
|
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"bpf",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
|
|
|
},
|
|
|
|
Includes: &Filter{
|
|
|
|
Caps: []string{"CAP_BPF"},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
LinuxSyscall: specs.LinuxSyscall{
|
|
|
|
Names: []string{
|
|
|
|
"perf_event_open",
|
|
|
|
},
|
|
|
|
Action: specs.ActAllow,
|
|
|
|
},
|
|
|
|
Includes: &Filter{
|
|
|
|
Caps: []string{"CAP_PERFMON"},
|
|
|
|
},
|
|
|
|
},
|
2016-05-06 14:17:41 +00:00
|
|
|
}
|
|
|
|
|
2021-07-30 14:47:17 +00:00
|
|
|
errnoRet := uint(unix.EPERM)
|
2020-09-18 16:14:16 +00:00
|
|
|
return &Seccomp{
|
2021-07-16 15:55:04 +00:00
|
|
|
LinuxSeccomp: specs.LinuxSeccomp{
|
2021-07-30 14:47:17 +00:00
|
|
|
DefaultAction: specs.ActErrno,
|
|
|
|
DefaultErrnoRet: &errnoRet,
|
2021-07-16 15:55:04 +00:00
|
|
|
},
|
|
|
|
ArchMap: arches(),
|
|
|
|
Syscalls: syscalls,
|
2016-05-06 14:17:41 +00:00
|
|
|
}
|
2015-12-18 18:01:58 +00:00
|
|
|
}
|