blob: 319f981b3cf39ce864c117e3ad2b0750c646fa3a [file] [log] [blame]
# Copyright 2018 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 allowed syscalls for runtime_probe skeleton + DBus
clock_gettime: 1
clock_gettime64: 1
pipe: 1
rt_sigaction: 1
epoll_create1: 1
getresuid32: 1
uname: 1
brk: 1
connect: 1
getsockname: 1
close: 1
poll: 1
stat64: 1
clock_getres: 1
clock_getres_time64: 1
write: 1
getegid32: 1
rt_sigprocmask: 1
send: 1
access: 1
ARM_set_tls: 1
_llseek: 1
getpid: 1
recvmsg: 1
signalfd4: 1
set_tid_address: 1
ugetrlimit: 1
getuid32: 1
read: 1
readlink: 1
openat: 1
clone: 1
getgid32: 1
set_robust_list: 1
gettimeofday: 1
futex: 1
futex_time64: 1
munmap: 1
fcntl64: 1
execve: 1
wait4: 1
gettid: 1
geteuid32: 1
fstat64: 1
pipe2: 1
epoll_ctl: 1
getresgid32: 1
epoll_wait: 1
sendmsg: 1
# The following are syscalls required for running "ectool battery"
getdents64: 1
flock: 1
exit_group: 1
dup2: 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, 1c) (0xc01c3a00)
# 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
#
# Or
#
# For brillo::kLogToStderrIfTty. isatty(0) calls ioctl(0, TCGETS, *).
ioctl: arg1 == 0xc108ec01 || arg1 == 0xc01c3a00 || arg1 == 0xc014ec00 || arg0 == 0 && arg1 == TCGETS
# TODO(b/120826467) Disallow execve when accessing /dev/cros_ec
# without ectool is possible
lstat64: 1
prlimit64: 1
ftruncate: 1
mmap2: arg2 in ~PROT_EXEC || arg2 in ~PROT_WRITE
mprotect: arg2 == PROT_READ || arg2 == PROT_NONE
socket: arg0 == AF_UNIX && arg1 == SOCK_STREAM|SOCK_CLOEXEC && arg2 == 0