systemd: allow systemd-hostnamed to read udev runtime files

Fixes:
avc:  denied  { open } for  pid=392 comm="systemd-hostnam"
path="/run/udev/data/+dmi:id" dev="tmpfs" ino=609
scontext=system_u:system_r:systemd_hostnamed_t:s0-s15:c0.c1023
tcontext=system_u:object_r:udev_runtime_t:s0 tclass=file permissive=1

avc:  denied  { getattr } for  pid=392 comm="systemd-hostnam"
path="/run/udev/data/+dmi:id" dev="tmpfs" ino=609
scontext=system_u:system_r:systemd_hostnamed_t:s0-s15:c0.c1023
tcontext=system_u:object_r:udev_runtime_t:s0 tclass=file permissive=1

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
This commit is contained in:
Yi Zhao 2021-02-04 15:13:50 +08:00
parent 5eb43f0bca
commit 4c515c9f8b
1 changed files with 3 additions and 0 deletions

View File

@ -512,6 +512,9 @@ sysnet_manage_config(systemd_hostnamed_t)
systemd_log_parse_environment(systemd_hostnamed_t)
# Allow reading /run/udev/data/+dmi:id
udev_read_runtime_files(systemd_hostnamed_t)
optional_policy(`
dbus_connect_system_bus(systemd_hostnamed_t)
dbus_system_bus_client(systemd_hostnamed_t)