blob: d61ca84f270eb9a2338094b237a82567472b831b [file] [edit]
# Copyright 2020 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# This file lists out the seccomp policy for allowed syscalls on arc-adbd
# when it works with arcvm
# rseq should be first due to frequency and purpose to decrease nptl latency
rseq: 1
mmap: arg2 in ~PROT_EXEC || arg2 in ~PROT_WRITE
stat: 1
mprotect: arg2 in ~PROT_EXEC || arg2 in ~PROT_WRITE
close: 1
open: 1
openat: 1
read: 1
fstat: 1
write: 1
creat: 1
chown: 1
access: 1
faccessat: 1
faccessat2: 1
mount: arg3 == MS_BIND || arg3 == MS_NOSUID|MS_NODEV|MS_NOEXEC
rename: 1
# mknod should only be used to create FIFOs. 010777 means
# S_IFIFO|S_IRWXU|S_IRWXG|S_IRWXO.
mknod: arg1 in 010777
setpriority: 1
getuid:1
geteuid:1
getgid:1
getegid:1
epoll_create1:1
epoll_ctl: 1
epoll_wait: 1
pipe2:1
brk: 1
mkdir: 1
lstat: 1
unlink: 1
symlink: 1
rt_sigaction: 1
getdents: 1
restart_syscall: 1
exit: 1
exit_group: 1
rt_sigreturn: 1
rt_sigprocmask: 1
munmap: 1
tgkill: 1
sendto: 1
gettid:1
futex:1
pread64: 1
mremap: 1
poll: 1
signalfd4: 1
recvmsg: 1
readlink: 1
readlinkat: 1
# For modprobe(8)
clone: 1
execve: 1
wait4: 1
set_robust_list: 1
dup: 1
dup2: 1
getrlimit: 1
getdents64: 1
prctl: 1
arch_prctl: 1
uname: 1
newfstatat: 1
fcntl: 1
lseek: 1
finit_module: 1
fstatfs: 1
getrandom: arg2 in ~GRND_RANDOM
# For ArcVmAdbBridgeDbc
ioctl: arg1 == TCGETS || arg1 == TCSETS || \
arg1 == TCSETSW || arg1 == TCSETSF || \
arg1 == FIONREAD
getpid: 1
prlimit64: arg2 == 0 && arg3 != 0
# For syslog /dev/log and connection to the vsock socket
socket: arg0 == AF_VSOCK && arg1 == SOCK_STREAM || \
arg0 == AF_UNIX || arg0 == AF_NETLINK
connect: 1
bind: 1
getsockname: 1
setsockopt: 1
# For base::PlatformThread::Sleep()
nanosleep: 1
clock_nanosleep: 1
sched_yield: 1
set_tid_address: 1
# For dbc file watcher
inotify_init: 1
inotify_add_watch: 1
inotify_rm_watch: 1