logo

apparmor.d

Unnamed repository; edit this file 'description' to name the repository. git clone https://hacktivis.me/git/apparmor.d.git

opencl-pocl (2912B)


  1. # vim:syntax=apparmor
  2. # OpenCL access requirements for POCL implementation
  3. abi <abi/3.0>,
  4. include <abstractions/opencl-common>
  5. # Executables
  6. /usr/bin/{,@{multiarch}-}ld.bfd Cx -> opencl_pocl_ld,
  7. /usr/lib/llvm-[0-9]*.[0-9]*/bin/clang Cx -> opencl_pocl_clang,
  8. # System files
  9. / r, # libpocl.so -> libhwloc.so
  10. @{sys}/bus/pci/slots/ r, # libpocl.so -> hwloc_topology_load() from libhwloc.so
  11. @{sys}/bus/{cpu,node}/devices/ r, # libpocl.so -> libhwlock.so
  12. @{sys}/class/net/ r, # libpocl.so -> hwloc_pci_traverse_lookuposdevices_cb() from libhwloc.so
  13. @{sys}/devices/pci[0-9]*/**/ r, # for libpocl -> hwloc_linux_lookup_block_class() from libhwloc.so
  14. @{sys}/devices/pci[0-9]*/**/block/*/dev r, # libpocl.so -> hwloc_linux_lookup_host_block_class() from libhwloc.so
  15. @{sys}/devices/pci[0-9]*/**/{class,local_cpus} r, # libpocl.so -> libhwlock.so
  16. @{sys}/devices/pci[0-9]*/*/net/*/address r, # libpocl.so -> hwloc_pci_traverse_lookuposdevices_cb() from libhwloc.so
  17. @{sys}/devices/system/cpu/ r, # libpocl.so -> libnuma.so
  18. @{sys}/devices/system/cpu/cpu[0-9]*/cache/index[0-9]*/* r, # libpocl.so -> libhwloc.so
  19. @{sys}/devices/system/cpu/cpu[0-9]*/online r, # libpocl.so -> libhwlock.so
  20. @{sys}/devices/system/cpu/cpu[0-9]*/topology/* r, # *_siblings, physical_package_id and lot's of others, for libpocl.so -> libhwloc.so
  21. @{sys}/devices/system/cpu/cpufreq/policy[0-9]*/* r, # for clGetPlatformIDs() from libpocl.so
  22. @{sys}/devices/system/cpu/possible r, # libpocl.so -> libhwloc.so
  23. @{sys}/devices/virtual/dmi/id/{,*} r, # libpocl.so -> libhwloc.so
  24. @{sys}/fs/cgroup/cpuset/cpuset.{cpus,mems} r, # libpocl.so -> libhwloc.so
  25. @{sys}/kernel/mm/hugepages{/,/**} r, # libpocl.so -> libhwloc.so
  26. /usr/share/pocl/** r,
  27. @{run}/udev/data/*:* r, # libpocl.so -> hwloc_linux_block_class_fillinfos() from libhwloc.so
  28. # User files
  29. owner @{HOME}/.cache/pocl/ w,
  30. owner @{HOME}/.cache/pocl/kcache/ w,
  31. owner @{HOME}/.cache/pocl/kcache/** rw,
  32. owner @{HOME}/.cache/pocl/kcache/**.so mrw, # dangerous!
  33. owner @{PROC}/@{pid}/{cgroup,cpuset,status} r, # libpocl.so -> libhwloc.so, status for libpocl.so -> libnuma.so
  34. # Child profiles
  35. profile opencl_pocl_ld {
  36. include <abstractions/base>
  37. # Main executables
  38. /usr/bin/{,@{multiarch}-}ld.bfd mr,
  39. # User files
  40. owner @{HOME}/.cache/pocl/kcache/tempfile*.so rw,
  41. owner @{HOME}/.cache/pocl/kcache/**.so.o r,
  42. }
  43. profile opencl_pocl_clang {
  44. include <abstractions/base>
  45. # Main executables
  46. /usr/lib/llvm-[0-9]*.[0-9]*/bin/clang mr,
  47. # Additional executables
  48. /usr/bin/{,@{multiarch}-}ld.bfd ix, # TODO: transfer to opencl_ld child profile?
  49. # System files
  50. /etc/debian-version r,
  51. /etc/lsb-release r,
  52. # User files
  53. owner @{HOME}/.cache/pocl/kcache/*/*/*/*/*.so{,.o} rw,
  54. }
  55. # Include additions to the abstraction
  56. include if exists <abstractions/opencl-pocl.d>