Gentoo Archives: gentoo-commits

From: Jason Zaman <perfinion@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/hardened-refpolicy:master commit in: policy/modules/system/, policy/modules/kernel/
Date: Sat, 28 Nov 2020 23:09:34
Message-Id: 1605517423.de9c38bc9643b4d761a7eff93400c2232d75220c.perfinion@gentoo
1 commit: de9c38bc9643b4d761a7eff93400c2232d75220c
2 Author: Anthony PERARD <anthony.perard <AT> citrix <DOT> com>
3 AuthorDate: Tue Oct 27 17:22:28 2020 +0000
4 Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org>
5 CommitDate: Mon Nov 16 09:03:43 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=de9c38bc
7
8 xen: Allow xenstored to map /proc/xen/xsd_kva
9
10 xenstored is using mmap() on /proc/xen/xsd_kva, and when the SELinux
11 boolean "domain_can_mmap_files" in CentOS is set to false the mmap()
12 call fails.
13
14 Signed-off-by: Anthony PERARD <anthony.perard <AT> citrix.com>
15 Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org>
16
17 policy/modules/kernel/filesystem.if | 18 ++++++++++++++++++
18 policy/modules/system/xen.te | 1 +
19 2 files changed, 19 insertions(+)
20
21 diff --git a/policy/modules/kernel/filesystem.if b/policy/modules/kernel/filesystem.if
22 index aa855bd0..05ddc598 100644
23 --- a/policy/modules/kernel/filesystem.if
24 +++ b/policy/modules/kernel/filesystem.if
25 @@ -5328,6 +5328,24 @@ interface(`fs_manage_xenfs_files',`
26 manage_files_pattern($1, xenfs_t, xenfs_t)
27 ')
28
29 +########################################
30 +## <summary>
31 +## Map files a XENFS filesystem.
32 +## </summary>
33 +## <param name="domain">
34 +## <summary>
35 +## Domain allowed access.
36 +## </summary>
37 +## </param>
38 +#
39 +interface(`fs_mmap_xenfs_files',`
40 + gen_require(`
41 + type xenfs_t;
42 + ')
43 +
44 + allow $1 xenfs_t:file map;
45 +')
46 +
47 ########################################
48 ## <summary>
49 ## Do not audit attempts to create,
50
51 diff --git a/policy/modules/system/xen.te b/policy/modules/system/xen.te
52 index 2c95d0ca..82328cbb 100644
53 --- a/policy/modules/system/xen.te
54 +++ b/policy/modules/system/xen.te
55 @@ -459,6 +459,7 @@ files_read_usr_files(xenstored_t)
56
57 fs_search_xenfs(xenstored_t)
58 fs_manage_xenfs_files(xenstored_t)
59 +fs_mmap_xenfs_files(xenstored_t)
60
61 term_use_generic_ptys(xenstored_t)