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 23kill: 1 24madvise: arg2 == MADV_DONTNEED || arg2 == MADV_DONTDUMP || arg2 == MADV_REMOVE 25mremap: 1 26munmap: 1 27nanosleep: 1 28clock_nanosleep: 1 29pipe2: 1 30poll: 1 31ppoll: 1 32prctl: arg0 == PR_SET_NAME || arg0 == PR_GET_NAME 33read: 1 34readlink: 1 35readlinkat: 1 36readv: 1 37recvfrom: 1 38recvmsg: 1 39restart_syscall: 1 40rt_sigaction: 1 41rt_sigprocmask: 1 42rt_sigreturn: 1 43sched_getaffinity: 1 44sched_yield: 1 45sendmsg: 1 46sendto: 1 47set_robust_list: 1 48sigaltstack: 1 49write: 1 50writev: 1 51uname: 1 52 53# Rules specific to gpu 54connect: 1 55# 1033 is F_ADD_SEALS, 1034 is F_GET_SEALS 56fcntl: arg1 == F_DUPFD_CLOEXEC || arg1 == F_SETFD || arg1 == F_GETFL || \ 57 arg1 == F_SETFL || arg1 == 1033 || arg1 == 1034 58fstat: 1 59# Used to set of size new memfd. 60ftruncate: 1 61getdents: 1 62getdents64: 1 63geteuid: 1 64getrandom: 1 65getuid: 1 66# 0x40086200 = DMA_BUF_IOCTL_SYNC, 0x6400 == DRM_IOCTL_BASE, 0x40087543 == UDMABUF_CREATE_LIST 67ioctl: arg1 == FIONBIO || arg1 == FIOCLEX || arg1 == 0x40086200 || arg1 & 0x6400 || arg1 == 0x40087543 68lseek: 1 69lstat: 1 70# Used for sharing memory with wayland. Also internally by Intel anv. 71# arg1 == MFD_CLOEXEC|MFD_ALLOW_SEALING or simply MFD_CLOEXEC. 72memfd_create: arg1 == 3 || arg1 == 1 73# mmap/mprotect/open/openat differ from the common_device.policy 74mmap: arg2 == PROT_READ|PROT_WRITE || arg2 == PROT_NONE || arg2 == PROT_READ|PROT_EXEC || arg2 == PROT_WRITE || arg2 == PROT_READ 75mprotect: arg2 == PROT_READ|PROT_WRITE || arg2 == PROT_NONE || arg2 == PROT_READ 76open: 1 77openat: 1 78stat: 1 79statx: 1 80sysinfo: 1 81fstatfs: 1 82 83# Required for perfetto tracing 84# fcntl: arg1 == F_SETFD || arg1 == F_GETFL || arg1 == F_SETFL (merged above) 85getsockopt: 1 86shutdown: 1 87 88# Rules for Mesa's shader binary cache. 89flock: 1 90mkdir: 1 91newfstatat: 1 92rename: 1 93setpriority: 1 94unlink: 1 95 96# Rules specific to AMD gpus. 97sched_setscheduler: 1 98sched_setaffinity: 1 99kcmp: 1 100 101# Rules for Vulkan loader / layers 102access: 1 103getgid: 1 104getegid: 1 105