1# Copyright 2021 The Chromium OS Authors. All rights reserved. 2# Use of this source code is governed by a BSD-style license that can be 3# found in the LICENSE file. 4 5# Rules from common_device.policy with some rules removed because they block certain flags needed 6# for gpu. 7brk: 1 8clock_gettime: 1 9close: 1 10dup2: 1 11dup: 1 12epoll_create1: 1 13epoll_ctl: 1 14epoll_wait: 1 15eventfd2: 1 16exit: 1 17exit_group: 1 18futex: 1 19getcwd: 1 20getpid: 1 21gettid: 1 22gettimeofday: 1 23io_uring_setup: 1 24io_uring_enter: 1 25kill: 1 26madvise: arg2 == MADV_DONTNEED || arg2 == MADV_DONTDUMP || arg2 == MADV_REMOVE 27mremap: 1 28munmap: 1 29nanosleep: 1 30clock_nanosleep: 1 31pipe2: 1 32poll: 1 33ppoll: 1 34read: 1 35readlink: 1 36readlinkat: 1 37readv: 1 38recvfrom: 1 39recvmsg: 1 40restart_syscall: 1 41rt_sigaction: 1 42rt_sigprocmask: 1 43rt_sigreturn: 1 44sched_getaffinity: 1 45sched_yield: 1 46sendmsg: 1 47sendto: 1 48set_robust_list: 1 49sigaltstack: 1 50write: 1 51writev: 1 52uname: 1 53 54# Rules specific to gpu 55connect: 1 56# 1033 is F_ADD_SEALS, 1034 is F_GET_SEALS 57fcntl: arg1 == F_DUPFD_CLOEXEC || arg1 == F_SETFD || arg1 == F_GETFL || \ 58arg1 == F_SETFL || arg1 == 1033 || arg1 == 1034 59fstat: 1 60# Used to set of size new memfd. 61ftruncate: 1 62getdents: 1 63getdents64: 1 64geteuid: 1 65getrandom: 1 66getuid: 1 67# 0x40086200 = DMA_BUF_IOCTL_SYNC, 0x6400 == DRM_IOCTL_BASE, 0x40087543 == UDMABUF_CREATE_LIST 68ioctl: arg1 == FIONBIO || arg1 == FIOCLEX || arg1 == 0x40086200 || arg1 & 0x6400 || arg1 == 0x40087543 69lseek: 1 70lstat: 1 71# Used for sharing memory with wayland. Also internally by Intel anv. 72# arg1 == MFD_CLOEXEC|MFD_ALLOW_SEALING or simply MFD_CLOEXEC. 73memfd_create: arg1 == 3 || arg1 == 1 74# mmap/mprotect/open/openat differ from the common_device.policy 75mmap: arg2 == PROT_READ|PROT_WRITE || arg2 == PROT_NONE || arg2 == PROT_READ|PROT_EXEC || arg2 == PROT_WRITE || arg2 == PROT_READ 76mprotect: arg2 == PROT_READ|PROT_WRITE || arg2 == PROT_NONE || arg2 == PROT_READ 77open: 1 78openat: 1 79stat: 1 80statx: 1 81sysinfo: 1 82fstatfs: 1 83prctl: arg0 == PR_SET_NAME || arg0 == PR_GET_NAME 84 85# Required for perfetto tracing 86# fcntl: arg1 == F_SETFD || arg1 == F_GETFL || arg1 == F_SETFL (merged above) 87getsockopt: 1 88shutdown: 1 89 90# Rules for Mesa's shader binary cache. 91flock: 1 92mkdir: 1 93newfstatat: 1 94rename: 1 95setpriority: 1 96unlink: 1 97 98# Rules specific to AMD gpus. 99sched_setscheduler: 1 100sched_setaffinity: 1 101kcmp: 1 102 103# Rules for Vulkan loader / layers 104access: 1 105getgid: 1 106getegid: 1 107clone3: 1 108rseq: 1 109