1 |
commit: 51c0bb3f83ad430565b85ce7c16608e8174a9014 |
2 |
Author: Kenton Groombridge <me <AT> concord <DOT> sh> |
3 |
AuthorDate: Thu Mar 31 19:04:26 2022 +0000 |
4 |
Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org> |
5 |
CommitDate: Sat Apr 9 19:28:30 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=51c0bb3f |
7 |
|
8 |
container, init: allow init to remount container filesystems |
9 |
|
10 |
Allow init to remount container filesystems. This is in support of other |
11 |
services starting with NoNewPrivileges while already running containers |
12 |
have mounted filesystems. |
13 |
|
14 |
Signed-off-by: Kenton Groombridge <me <AT> concord.sh> |
15 |
Signed-off-by: Jason Zaman <perfinion <AT> gentoo.org> |
16 |
|
17 |
policy/modules/services/container.if | 19 +++++++++++++++++++ |
18 |
policy/modules/system/init.te | 4 ++++ |
19 |
2 files changed, 23 insertions(+) |
20 |
|
21 |
diff --git a/policy/modules/services/container.if b/policy/modules/services/container.if |
22 |
index bf5ecfb5..541eb8a5 100644 |
23 |
--- a/policy/modules/services/container.if |
24 |
+++ b/policy/modules/services/container.if |
25 |
@@ -1099,6 +1099,25 @@ interface(`container_relabel_all_content',` |
26 |
allow $1 container_file_t:dir_file_class_set { relabelfrom relabelto }; |
27 |
') |
28 |
|
29 |
+######################################## |
30 |
+## <summary> |
31 |
+## Allow the specified domain to |
32 |
+## remount container filesystems. |
33 |
+## </summary> |
34 |
+## <param name="domain"> |
35 |
+## <summary> |
36 |
+## Domain allowed access. |
37 |
+## </summary> |
38 |
+## </param> |
39 |
+# |
40 |
+interface(`container_remount_fs',` |
41 |
+ gen_require(` |
42 |
+ type container_file_t; |
43 |
+ ') |
44 |
+ |
45 |
+ allow $1 container_file_t:filesystem remount; |
46 |
+') |
47 |
+ |
48 |
######################################## |
49 |
## <summary> |
50 |
## Allow the specified domain to |
51 |
|
52 |
diff --git a/policy/modules/system/init.te b/policy/modules/system/init.te |
53 |
index 6e1baef9..db06551c 100644 |
54 |
--- a/policy/modules/system/init.te |
55 |
+++ b/policy/modules/system/init.te |
56 |
@@ -543,6 +543,10 @@ ifdef(`init_systemd',` |
57 |
clock_read_adjtime(init_t) |
58 |
') |
59 |
|
60 |
+ optional_policy(` |
61 |
+ container_remount_fs(init_t) |
62 |
+ ') |
63 |
+ |
64 |
optional_policy(` |
65 |
systemd_dbus_chat_logind(init_t) |
66 |
systemd_search_all_user_keys(init_t) |