2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-11-21 09:52:17 +00:00

fix(xcat-core): the image build cannot open the fifo dnf writes its progress to

The last two enforced denials of the enforcing run were
xcat_image_t tmp_t:fifo_file create. Neither provisioning case failed on
them, because dnf falls back to its plain output, but the grant belongs
with the rest of the /tmp set of that domain.

Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
This commit is contained in:
Daniel Hilst
2026-10-15 03:16:26 -03:00
parent 078f607448
commit ca04e2c8ae
+6
View File
@@ -313,6 +313,8 @@ storage_getattr_fixed_disk_dev(xcat_image_t)
storage_getattr_removable_dev(xcat_image_t)
dev_create_generic_chr_files(xcat_image_t)
manage_chr_files_pattern(xcat_image_t, tmp_t, tmp_t)
# dnf opens a fifo under /tmp for its progress output.
manage_fifo_files_pattern(xcat_image_t, tmp_t, tmp_t)
fs_getattr_nsfs_files(xcat_image_t)
# dnf installs packages that own files of every type, including the security
# types, and it relabels what it writes. The grant is per class over the
@@ -335,6 +337,10 @@ allow xcat_image_t file_type:dir relabel_dir_perms;
allow xcat_image_t file_type:file relabel_file_perms;
allow xcat_image_t file_type:lnk_file relabel_lnk_file_perms;
allow xcat_image_t file_type:file map;
# The image holds its own /dev. device_t is a device type, not a member of the
# file_type attribute, so the grant above does not reach it.
manage_chr_files_pattern(xcat_image_t, device_t, device_t)
manage_blk_files_pattern(xcat_image_t, device_t, device_t)
allow xcat_image_t device_t:chr_file setattr;
allow xcat_image_t self:capability audit_control;
allow xcat_image_t self:netlink_audit_socket nlmsg_readpriv;