Skip to content

Commit 92e54bf

Browse files
committed
Allow systemd-machined read svirt process state
As a result of systemd commit 119d332d9c2c [1] ("machine: do not allow unprivileged users to register other users' processes as machines"), additional checks for unprivileged users are now performed in machined. [1] systemd/systemd@119d332 The commit addresses the following AVC denials: type=AVC msg=audit(1761761320.303:568): avc: denied { search } for pid=1490 comm="systemd-machine" name="19272" dev="proc" ino=31558 scontext=system_u:system_r:systemd_machined_t:s0 tcontext=system_u:system_r:svirt_t:s0:c825,c980 tclass=dir permissive=0 type=AVC msg=audit(1761787546.949:757): avc: denied { open } for pid=1075 comm="systemd-machine" path="/proc/32908/stat" dev="proc" ino=169265 scontext=system_u:system_r:systemd_machined_t:s0 tcontext=system_u:system_r:svirt_t:s0:c274,c314 tclass=file permissive=0 Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2407206
1 parent 6b9f0bb commit 92e54bf

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

policy/modules/contrib/virt.if

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,6 +2237,25 @@ interface(`virt_virtqemud_read_state',`
22372237
ps_process_pattern($1, virtqemud_t)
22382238
')
22392239

2240+
########################################
2241+
## <summary>
2242+
## Read the svirt process state.
2243+
## </summary>
2244+
## <param name="domain">
2245+
## <summary>
2246+
## Domain allowed access.
2247+
## </summary>
2248+
## </param>
2249+
#
2250+
interface(`virt_svirt_read_state',`
2251+
gen_require(`
2252+
type svirt_t;
2253+
')
2254+
2255+
kernel_search_proc($1)
2256+
ps_process_pattern($1, svirt_t)
2257+
')
2258+
22402259
########################################
22412260
## <summary>
22422261
## Execute virsh in the caller domain.

policy/modules/system/systemd.te

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -631,6 +631,7 @@ optional_policy(`
631631
virt_rw_svirt_dev(systemd_machined_t)
632632
virt_getattr_sandbox_filesystem(systemd_machined_t)
633633
virt_read_sandbox_files(systemd_machined_t)
634+
virt_svirt_read_state(systemd_machined_t)
634635
')
635636

636637
#######################################

0 commit comments

Comments
 (0)