From 1a22a5ad7d81ed90d29687a3fca7ebbc61416fa7 Mon Sep 17 00:00:00 2001 From: Zdenek Pytela Date: Thu, 2 Jan 2025 18:03:20 +0100 Subject: [PATCH] Allow virtqemud relabelfrom virt_log_t files This is a follow-up commit to 5749a0a44e36 ("Allow virtqemud relabelfrom virt_log_t files"), as it turned out also relabelfrom is needed. The commit addresses the following AVC denial: type=PROCTITLE msg=audit(12/20/2024 09:06:12.607:2598) : proctitle=/usr/sbin/virtqemud --timeout 120 type=AVC msg=audit(12/20/2024 09:06:12.607:2598) : avc: denied { relabelto } for pid=39137 comm=rpc-virtqemud name=rhel-swtpm.log dev="dm-0" ino=202517283 scontext=system_u:system_r:virtqemud_t:s0 tcontext=system_u:object_r:virt_log_t:s0 tclass=file permissive=1 type=SYSCALL msg=audit(12/20/2024 09:06:12.607:2598) : arch=x86_64 syscall=setxattr success=yes exit=0 a0=0x55eb6bf9fa70 a1=0x7ff13bb37197 a2=0x7ff11c06a700 a3=0x20 items=0 ppid=38650 pid=39137 auid=unset uid=root gid=root euid=root suid=root fsuid=root egid=root sgid=root fsgid=root tty=(none) ses=unset comm=rpc-virtqemud exe=/usr/sbin/virtqemud subj=system_u:system_r:virtqemud_t:s0 key=(null) Resolves: RHEL-48236 --- policy/modules/contrib/virt.te | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/policy/modules/contrib/virt.te b/policy/modules/contrib/virt.te index b8df9e8e07..0078f627cd 100644 --- a/policy/modules/contrib/virt.te +++ b/policy/modules/contrib/virt.te @@ -2151,7 +2151,7 @@ files_lock_filetrans(virtqemud_t, virtqemud_lock_t, file) allow virtqemud_t virtqemud_var_run_t:dir relabelfrom; allow virtqemud_t virtqemud_var_run_t:sock_file relabelfrom; -allow virtqemud_t virt_log_t:file relabelfrom; +allow virtqemud_t virt_log_t:file relabel_file_perms; manage_dirs_pattern(virtqemud_t, virt_var_run_t, virt_var_run_t) manage_dirs_pattern(virtqemud_t, virtqemud_var_run_t, virtqemud_var_run_t)