Skip to content

Commit

Permalink
Allow virtnodedev watch mdevctl config dirs
Browse files Browse the repository at this point in the history
The commit addresses the following AVC denial:
type=AVC msg=audit(1727331873.951:1167): avc:  denied  { watch } for  pid=254281 comm="gmain" path="/etc/mdevctl.d/scripts.d" dev="sdc3" ino=10149729 scontext=system_u:system_r:virtnodedevd_t:s0 tcontext=system_u:object_r:mdevctl_conf_t:s0 tclass=dir permissive=0

Resolves: rhbz#2314826
  • Loading branch information
zpytela committed Sep 26, 2024
1 parent 3ba70ae commit 47135ca
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion policy/modules/contrib/virt.te
Original file line number Diff line number Diff line change
Expand Up @@ -2008,9 +2008,9 @@ dev_rw_sysfs(virtnodedevd_t)
dev_write_sysfs_dirs(virtnodedevd_t)

files_map_var_lib_files(virtnodedevd_t)
files_watch_etc_dirs(virtnodedevd_t)
files_etc_filetrans_mdevctl_conf(virtnodedevd_t)
files_manage_mdevctl_conf_files(virtnodedevd_t)
files_watch_mdevctl_conf_dirs(virtnodedevd_t)

miscfiles_read_hwdata(virtnodedevd_t)

Expand Down
19 changes: 19 additions & 0 deletions policy/modules/kernel/files.if
Original file line number Diff line number Diff line change
Expand Up @@ -6084,6 +6084,25 @@ interface(`files_manage_mdevctl_conf_files',`
manage_files_pattern($1, mdevctl_conf_t, mdevctl_conf_t)
')

#######################################
## <summary>
## Watch mdevctl configuration dirs
## </summary>
## <param name="domain">
## <summary>
## Domain allowed access.
## </summary>
## </param>
#
interface(`files_watch_mdevctl_conf_dirs',`
gen_require(`
type mdevctl_conf_t;
')

files_search_etc(mdevctl_conf_t)
allow $1 mdevctl_conf_t:dir watch_dir_perms;
')

###################################
## <summary>
## Create /etc/mdevctl.d with the correct type
Expand Down

0 comments on commit 47135ca

Please sign in to comment.