blob: 0cc776b4d1a282b84a2f5cd8e7ff7653f26c085a [file] [log] [blame]
# Copyright 2019 The Chromium OS Authors. All rights reserved.
# 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.
# The following are generic syscalls.
write: 1
getuid: 1
geteuid: 1
getgid: 1
getegid: 1
epoll_create1: 1
pipe2: 1
epoll_ctl: 1
gettid: 1
rt_sigprocmask: 1
signalfd4: 1
fstat: 1
clock_getres: 1
getresuid: 1
getresgid: 1
fcntl: 1
getsockname: 1
poll: 1
read: 1
openat: 1
clone: 1
set_robust_list: 1
# base::FileEnumerator::Next()
getdents: 1
wait4: 1
munmap: 1
sendto: 1
sendmsg: 1
recvmsg: 1
epoll_wait: 1
close: 1
exit_group: 1
stat: 1
access: 1
# The following are syscalls enabled by -L in minijail.
connect: 1
lseek: 1
# The following are syscalls required for ectool_i2cread
rt_sigaction: 1
uname: 1
lstat: 1
mprotect: arg2 == PROT_READ || arg2 == PROT_NONE
execve: 1
brk: 1
flock: 1
mmap: arg2 == PROT_READ || arg2 == PROT_READ|PROT_WRITE || arg2 == PROT_READ|PROT_EXEC
dup2: 1
arch_prctl: 1
getpid: 1
set_tid_address: 1
getdents64: 1
# ioctl:
# arg1 == _IOC(_IOC_READ|_IOC_WRITE, 0xec, 0x1, 0x108) (0xc108ec01) ||
# arg1 == _IOC(_IOC_READ|_IOC_WRITE, 0xec, 0, 0x14) (0xc014ec00) ||
# arg1 == _IOC(_IOC_READ|_IOC_WRITE, 0x3a, 0, 0x28) (0xc0283a00)
#
# Driver type 0x3a (":") = CROS_EC_DEV_IOC
# (Old iotcl format, used by ChromeOS 3.18 and older)
#
# Driver type 0xec = CROS_EC_DEV_IOC_V2
# (New ioctl format, used by ChromeOS 4.4 or later as well as upstream 4.0+)
# Please refer to src/platform/ec/util/cros_ec_dev.h for more info
ioctl: arg1 == 0xc108ec01 || arg1 == 0xc0283a00 || arg1 == 0xc014ec00
# TODO(b/120826467) Disallow execve when accessing /dev/cros_ec
# without ectool is possible
pipe: 1
prlimit64: 1
setgroups: 1
setresgid: 1
setresuid: 1