Skip to content

Commit

Permalink
Allow virtqemud additional permissions for tmpfs_t blk devices
Browse files Browse the repository at this point in the history
The following permissions were added: create, relabelfrom, setattr.

Resolves: RHEL-61235
  • Loading branch information
zpytela committed Dec 12, 2024
1 parent 248f810 commit d46e065
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
3 changes: 3 additions & 0 deletions policy/modules/contrib/virt.te
Original file line number Diff line number Diff line change
Expand Up @@ -2231,6 +2231,9 @@ fs_manage_tmpfs_dirs(virtqemud_t)
fs_manage_tmpfs_symlinks(virtqemud_t)
fs_mount_tmpfs(virtqemud_t)
fs_read_nsfs_files(virtqemud_t)
fs_create_tmpfs_chr_blk_files(virtqemud_t)
fs_setattr_tmpfs_chr_blk_files(virtqemud_t)
fs_relabel_tmpfs_blk_file(virtqemud_t)
fs_relabel_tmpfs_chr_file(virtqemud_t)

seutil_read_default_contexts(virtqemud_t)
Expand Down
36 changes: 36 additions & 0 deletions policy/modules/kernel/filesystem.if
Original file line number Diff line number Diff line change
Expand Up @@ -6015,6 +6015,42 @@ interface(`fs_rw_tmpfs_chr_files',`
rw_chr_files_pattern($1, tmpfs_t, tmpfs_t)
')

########################################
## <summary>
## Create character nodes on tmpfs filesystems.
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
## </param>
#
interface(`fs_create_tmpfs_chr_blk_files',`
gen_require(`
type tmpfs_t;
')

allow $1 tmpfs_t:chr_file create_blk_file_perms;
')

########################################
## <summary>
## Set attributes of character nodes on tmpfs filesystems.
## </summary>
## <param name="domain">
## <summary>
## Domain to not audit.
## </summary>
## </param>
#
interface(`fs_setattr_tmpfs_chr_blk_files',`
gen_require(`
type tmpfs_t;
')

allow $1 tmpfs_t:chr_file setattr;
')

########################################
## <summary>
## Do not audit attempts to read and write character nodes on tmpfs filesystems.
Expand Down

0 comments on commit d46e065

Please sign in to comment.