|
| 1 | +policy_module(wayland) |
| 2 | + |
| 3 | +######################################## |
| 4 | +# |
| 5 | +# Declarations |
| 6 | +# |
| 7 | + |
| 8 | +attribute wayland_compositor; |
| 9 | +attribute wayland_client; |
| 10 | + |
| 11 | +# For use by clients only allowed to talk through security_context restricted sockets. |
| 12 | +attribute wayland_client_sandboxed; |
| 13 | + |
| 14 | +type wayland_runtime_t; |
| 15 | +files_runtime_file(wayland_runtime_t) |
| 16 | +userdom_user_runtime_content(wayland_runtime_t) |
| 17 | + |
| 18 | +# For use by sandbox engines implementing the security_context protocol. |
| 19 | +type wayland_runtime_sandboxed_t; |
| 20 | +files_runtime_file(wayland_runtime_t) |
| 21 | +userdom_user_runtime_content(wayland_runtime_t) |
| 22 | + |
| 23 | +# No need to distinguish between the shm of sandboxed and unsandboxed clients; |
| 24 | +# all clients should have their own shm type, this attribute is only to group them |
| 25 | +# and grant wayland_compositor access to them. |
| 26 | +attribute wayland_client_tmpfs_type; |
| 27 | + |
| 28 | +############################## |
| 29 | +# |
| 30 | +# Local Policy |
| 31 | +# |
| 32 | + |
| 33 | +allow wayland_compositor wayland_client_tmpfs_type:file { mmap_rw_inherited_file_perms }; |
| 34 | +allow wayland_compositor wayland_client:fd use; |
| 35 | +allow wayland_compositor wayland_client_sandboxed:fd use; |
| 36 | + |
| 37 | +# Compositors may make more privileged sockets in $XDG_RUNTIME_DIR, so let's |
| 38 | +# hardcode in WAYLAND_DISPLAY so we can give other sockets created a higher level |
| 39 | +# of privilege (namebased filetransitions are not supported yet). |
| 40 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, socket, "wayland-0") |
| 41 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, socket, "wayland-1") |
| 42 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, socket, "wayland-2") |
| 43 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, socket, "wayland-3") |
| 44 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, socket, "wayland-4") |
| 45 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, socket, "wayland-5") |
| 46 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, socket, "wayland-6") |
| 47 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, socket, "wayland-7") |
| 48 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, socket, "wayland-8") |
| 49 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, socket, "wayland-9") |
| 50 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, file, "wayland-0.lock") |
| 51 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, file, "wayland-1.lock") |
| 52 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, file, "wayland-2.lock") |
| 53 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, file, "wayland-3.lock") |
| 54 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, file, "wayland-4.lock") |
| 55 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, file, "wayland-5.lock") |
| 56 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, file, "wayland-6.lock") |
| 57 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, file, "wayland-7.lock") |
| 58 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, file, "wayland-8.lock") |
| 59 | +userdom_user_runtime_filetrans(wayland_compositor, wayland_runtime_t, file, "wayland-9.lock") |
| 60 | + |
| 61 | +# GPU Access |
| 62 | +dev_rw_dri(wayland_compositor) |
| 63 | + |
| 64 | +# For seats |
| 65 | +systemd_use_logind_fds(wayland_compositor) |
| 66 | + |
| 67 | +# /dev/input |
| 68 | +dev_rw_input_dev(wayland_compositor) |
| 69 | + |
| 70 | +files_read_usr_files(wayland_compositor) |
| 71 | + |
| 72 | +# Fonts |
| 73 | +miscfiles_read_fonts(wayland_compositor) |
| 74 | +xserver_use_user_fonts(wayland_compositor) |
| 75 | + |
| 76 | +xserver_read_xkb_libs(wayland_compositor) |
| 77 | +xserver_rw_mesa_shader_cache(wayland_compositor) |
0 commit comments