xen: Allow xenstored to map /proc/xen/xsd_kva
PATCH v2 1/1 xen: Allow xenstored to map /proc/xen/xsd_kva
xenstored is using mmap() on /proc/xen/xsd_kva, and when the SELinux boolean "domain_can_mmap_files" in CentOS is set to false the mmap() call fails.
Signed-off-by Anthony PERARD <[email protected]>
---
v2: Declare an interface instead of using allow in xen.te directly.
--- policy/modules/kernel/filesystem.if | 18 ++++++++++++++++++ policy/modules/system/xen.te | 1 + 2 files changed, 19 insertions(+)
policy/modules/kernel/filesystem.if +18 -0
@@ -5310,6 +5310,24 @@ interface(`fs_manage_xenfs_files',` manage_files_pattern($1, xenfs_t, xenfs_t) ') +######################################## +## <summary> +## Map files a XENFS filesystem. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`fs_mmap_xenfs_files',` + gen_require(` + type xenfs_t; + ') + + allow $1 xenfs_t:file map; +') + ######################################## ## <summary> ## Do not audit attempts to create,
policy/modules/system/xen.te +1 -0
@@ -459,6 +459,7 @@ files_read_usr_files(xenstored_t) fs_search_xenfs(xenstored_t) fs_manage_xenfs_files(xenstored_t) +fs_mmap_xenfs_files(xenstored_t) term_use_generic_ptys(xenstored_t)
Signature · 1 line
Anthony PERARD
Quoted 46 lines · Anthony PERARD
xenstored is using
mmap()on/proc/xen/xsd_kva, and when the SELinux boolean "domain_can_mmap_files" in CentOS is set to false themmap()call fails.Signed-off-by Anthony PERARD <[email protected]>---
v2: Declare an interface instead of using allow in xen.te directly.--- policy/modules/kernel/filesystem.if | 18 ++++++++++++++++++ policy/modules/system/xen.te | 1 + 2 files changed, 19 insertions(+)policy/modules/kernel/filesystem.if +18
-0@@ -5310,6 +5310,24 @@ interface(`fs_manage_xenfs_files',` manage_files_pattern($1, xenfs_t, xenfs_t) ') +######################################## +## <summary> +## Map files a XENFS filesystem. +## </summary> +## <param name="domain"> +## <summary> +## Domain allowed access. +## </summary> +## </param> +# +interface(`fs_mmap_xenfs_files',` + gen_require(` + type xenfs_t; + ') + + allow $1 xenfs_t:file map; +') + ######################################## ## <summary> ## Do not audit attempts to create,policy/modules/system/xen.te +0
-0
policy/modules/system/xen.te files_read_usr_files(xenstored_t) · line 464
Quoted 6 lines
policy/modules/system/xen.te +1
-0@@ -459,6 +459,7 @@ files_read_usr_files(xenstored_t) fs_search_xenfs(xenstored_t) fs_manage_xenfs_files(xenstored_t) +fs_mmap_xenfs_files(xenstored_t) term_use_generic_ptys(xenstored_t)
Merged.
Signature · 1 line
Chris PeBenito