commit: de9c38bc9643b4d761a7eff93400c2232d75220c
Author: Anthony PERARD <anthony.perard <AT> citrix <DOT> com>
AuthorDate: Tue Oct 27 17:22:28 2020 +0000
Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
CommitDate: Mon Nov 16 09:03:43 2020 +0000
URL:
https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=de9c38bc
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 <anthony.perard <AT> citrix.com>
Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
policy/modules/kernel/filesystem.if | 18 ++++++++++++++++++
policy/modules/system/xen.te | 1 +
2 files changed, 19 insertions(+)
diff --git a/policy/modules/kernel/filesystem.if
b/policy/modules/kernel/filesystem.if
index aa855bd0..05ddc598 100644
--- a/policy/modules/kernel/filesystem.if
+++ b/policy/modules/kernel/filesystem.if
@@ -5328,6 +5328,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,
diff --git a/policy/modules/system/xen.te b/policy/modules/system/xen.te
index 2c95d0ca..82328cbb 100644
--- a/policy/modules/system/xen.te
+++ b/policy/modules/system/xen.te
@@ -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)