1 |
commit: 9d002b3d54f8278c9856d71a828cb59816384376 |
2 |
Author: Sven Vermeulen <sven.vermeulen <AT> siphos <DOT> be> |
3 |
AuthorDate: Thu Nov 27 22:15:40 2014 +0000 |
4 |
Commit: Sven Vermeulen <swift <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Nov 27 22:15:40 2014 +0000 |
6 |
URL: http://sources.gentoo.org/gitweb/?p=proj/hardened-refpolicy.git;a=commit;h=9d002b3d |
7 |
|
8 |
Fix bug #529208 - Grant dmesg access to /dev/kmsg and allow dmesg for sysadm_t |
9 |
|
10 |
--- |
11 |
policy/modules/admin/dmesg.if | 28 ++++++++++++++++++++++++++++ |
12 |
policy/modules/admin/dmesg.te | 3 +++ |
13 |
policy/modules/roles/sysadm.te | 5 +++++ |
14 |
3 files changed, 36 insertions(+) |
15 |
|
16 |
diff --git a/policy/modules/admin/dmesg.if b/policy/modules/admin/dmesg.if |
17 |
index e1973c7..1b6e1b2 100644 |
18 |
--- a/policy/modules/admin/dmesg.if |
19 |
+++ b/policy/modules/admin/dmesg.if |
20 |
@@ -38,3 +38,31 @@ interface(`dmesg_exec',` |
21 |
corecmd_search_bin($1) |
22 |
can_exec($1, dmesg_exec_t) |
23 |
') |
24 |
+ |
25 |
+# This should be in an ifdef distro_gentoo but that is not allowed in an if file |
26 |
+ |
27 |
+######################################## |
28 |
+## <summary> |
29 |
+## Execute dmesg in the dmesg_t domain, and allow the calling role |
30 |
+## the dmesg_t domain. |
31 |
+## </summary> |
32 |
+## <param name="domain"> |
33 |
+## <summary> |
34 |
+## Domain allowed access. |
35 |
+## </summary> |
36 |
+## </param> |
37 |
+## <param name="role"> |
38 |
+## <summary> |
39 |
+## Role allowed access. |
40 |
+## </summary> |
41 |
+## </param> |
42 |
+## <rolecap/> |
43 |
+# |
44 |
+interface(`dmesg_run,` |
45 |
+ gen_require(` |
46 |
+ type dmesg_t; |
47 |
+ ') |
48 |
+ |
49 |
+ dmesg_domtrans($1) |
50 |
+ role $2 types dmesg_t; |
51 |
+') |
52 |
|
53 |
diff --git a/policy/modules/admin/dmesg.te b/policy/modules/admin/dmesg.te |
54 |
index ee07743..544a430 100644 |
55 |
--- a/policy/modules/admin/dmesg.te |
56 |
+++ b/policy/modules/admin/dmesg.te |
57 |
@@ -63,4 +63,7 @@ ifdef(`distro_gentoo',` |
58 |
# dmesg_t policy |
59 |
# |
60 |
dev_dontaudit_rw_generic_chr_files(dmesg_t) # early access when /dev/console is not relabeled by udev yet |
61 |
+ |
62 |
+ # Bug 529208 |
63 |
+ dev_read_kmsg(dmesg_t) |
64 |
') |
65 |
|
66 |
diff --git a/policy/modules/roles/sysadm.te b/policy/modules/roles/sysadm.te |
67 |
index 7e497b0..76da241 100644 |
68 |
--- a/policy/modules/roles/sysadm.te |
69 |
+++ b/policy/modules/roles/sysadm.te |
70 |
@@ -493,6 +493,11 @@ ifdef(`distro_gentoo',` |
71 |
') |
72 |
|
73 |
optional_policy(` |
74 |
+ # Bug 529208 |
75 |
+ dmesg_run(sysadm_t, sysadm_r) |
76 |
+ ') |
77 |
+ |
78 |
+ optional_policy(` |
79 |
dnsmasq_admin(sysadm_t, sysadm_r) |
80 |
') |