selinux-refpolicy.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anthony PERARD <anthony.perard@citrix.com>
To: <selinux-refpolicy@vger.kernel.org>
Cc: Anthony PERARD <anthony.perard@citrix.com>
Subject: [PATCH v2] xen: Allow xenstored to map /proc/xen/xsd_kva
Date: Tue, 27 Oct 2020 17:22:28 +0000	[thread overview]
Message-ID: <20201027172228.528204-1-anthony.perard@citrix.com> (raw)

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@citrix.com>
---
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(+)

diff --git a/policy/modules/kernel/filesystem.if b/policy/modules/kernel/filesystem.if
index b52fc769236b..b85ae2f6e851 100644
--- a/policy/modules/kernel/filesystem.if
+++ b/policy/modules/kernel/filesystem.if
@@ -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,
diff --git a/policy/modules/system/xen.te b/policy/modules/system/xen.te
index 2c95d0ca3bbd..82328cbbbaa3 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)
 
-- 
Anthony PERARD


             reply	other threads:[~2020-10-27 17:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 17:22 Anthony PERARD [this message]
2020-11-05 11:55 ` [PATCH v2] xen: Allow xenstored to map /proc/xen/xsd_kva Chris PeBenito

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201027172228.528204-1-anthony.perard@citrix.com \
    --to=anthony.perard@citrix.com \
    --cc=selinux-refpolicy@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).