1 |
commit: 3aa651f4510a18755348107c754f635db5a4b758 |
2 |
Author: Jason Zaman <jason <AT> perfinion <DOT> com> |
3 |
AuthorDate: Wed Jun 1 16:08:55 2016 +0000 |
4 |
Commit: Jason Zaman <perfinion <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jun 1 18:20:07 2016 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/hardened-refpolicy.git/commit/?id=3aa651f4 |
7 |
|
8 |
userdomain: user_tmp requires searching /run/user |
9 |
|
10 |
policy/modules/system/userdomain.if | 51 +++++++++++++++++++++++++++++++++++++ |
11 |
1 file changed, 51 insertions(+) |
12 |
|
13 |
diff --git a/policy/modules/system/userdomain.if b/policy/modules/system/userdomain.if |
14 |
index 9284808..14dae15 100644 |
15 |
--- a/policy/modules/system/userdomain.if |
16 |
+++ b/policy/modules/system/userdomain.if |
17 |
@@ -344,6 +344,7 @@ interface(`userdom_exec_user_tmp_files',` |
18 |
|
19 |
exec_files_pattern($1, user_tmp_t, user_tmp_t) |
20 |
files_search_tmp($1) |
21 |
+ userdom_search_user_runtime($1) |
22 |
') |
23 |
|
24 |
####################################### |
25 |
@@ -2373,6 +2374,7 @@ interface(`userdom_write_user_tmp_sockets',` |
26 |
|
27 |
allow $1 user_tmp_t:sock_file write_sock_file_perms; |
28 |
files_search_tmp($1) |
29 |
+ userdom_search_user_runtime($1) |
30 |
') |
31 |
|
32 |
######################################## |
33 |
@@ -2391,7 +2393,9 @@ interface(`userdom_list_user_tmp',` |
34 |
') |
35 |
|
36 |
allow $1 user_tmp_t:dir list_dir_perms; |
37 |
+ allow $1 user_runtime_t:dir list_dir_perms; |
38 |
files_search_tmp($1) |
39 |
+ userdom_search_user_runtime($1) |
40 |
') |
41 |
|
42 |
######################################## |
43 |
@@ -2450,6 +2454,7 @@ interface(`userdom_read_user_tmp_files',` |
44 |
read_files_pattern($1, user_tmp_t, user_tmp_t) |
45 |
allow $1 user_tmp_t:dir list_dir_perms; |
46 |
files_search_tmp($1) |
47 |
+ userdom_search_user_runtime($1) |
48 |
') |
49 |
|
50 |
######################################## |
51 |
@@ -2508,6 +2513,7 @@ interface(`userdom_rw_user_tmp_files',` |
52 |
allow $1 user_tmp_t:dir list_dir_perms; |
53 |
rw_files_pattern($1, user_tmp_t, user_tmp_t) |
54 |
files_search_tmp($1) |
55 |
+ userdom_search_user_runtime($1) |
56 |
') |
57 |
|
58 |
######################################## |
59 |
@@ -2547,6 +2553,7 @@ interface(`userdom_read_user_tmp_symlinks',` |
60 |
read_lnk_files_pattern($1, user_tmp_t, user_tmp_t) |
61 |
allow $1 user_tmp_t:dir list_dir_perms; |
62 |
files_search_tmp($1) |
63 |
+ userdom_search_user_runtime($1) |
64 |
') |
65 |
|
66 |
######################################## |
67 |
@@ -2567,6 +2574,7 @@ interface(`userdom_manage_user_tmp_dirs',` |
68 |
|
69 |
manage_dirs_pattern($1, user_tmp_t, user_tmp_t) |
70 |
files_search_tmp($1) |
71 |
+ userdom_search_user_runtime($1) |
72 |
') |
73 |
|
74 |
######################################## |
75 |
@@ -2587,6 +2595,7 @@ interface(`userdom_manage_user_tmp_files',` |
76 |
|
77 |
manage_files_pattern($1, user_tmp_t, user_tmp_t) |
78 |
files_search_tmp($1) |
79 |
+ userdom_search_user_runtime($1) |
80 |
') |
81 |
|
82 |
######################################## |
83 |
@@ -2607,6 +2616,7 @@ interface(`userdom_manage_user_tmp_symlinks',` |
84 |
|
85 |
manage_lnk_files_pattern($1, user_tmp_t, user_tmp_t) |
86 |
files_search_tmp($1) |
87 |
+ userdom_search_user_runtime($1) |
88 |
') |
89 |
|
90 |
######################################## |
91 |
@@ -2627,6 +2637,7 @@ interface(`userdom_manage_user_tmp_pipes',` |
92 |
|
93 |
manage_fifo_files_pattern($1, user_tmp_t, user_tmp_t) |
94 |
files_search_tmp($1) |
95 |
+ userdom_search_user_runtime($1) |
96 |
') |
97 |
|
98 |
######################################## |
99 |
@@ -2647,6 +2658,7 @@ interface(`userdom_manage_user_tmp_sockets',` |
100 |
|
101 |
manage_sock_files_pattern($1, user_tmp_t, user_tmp_t) |
102 |
files_search_tmp($1) |
103 |
+ userdom_search_user_runtime($1) |
104 |
') |
105 |
|
106 |
######################################## |
107 |
@@ -2683,6 +2695,7 @@ interface(`userdom_user_tmp_filetrans',` |
108 |
|
109 |
filetrans_pattern($1, user_tmp_t, $2, $3, $4) |
110 |
files_search_tmp($1) |
111 |
+ userdom_search_user_runtime($1) |
112 |
') |
113 |
|
114 |
######################################## |
115 |
@@ -2717,6 +2730,44 @@ interface(`userdom_tmp_filetrans_user_tmp',` |
116 |
|
117 |
######################################## |
118 |
## <summary> |
119 |
+## Search users runtime directories. |
120 |
+## </summary> |
121 |
+## <param name="domain"> |
122 |
+## <summary> |
123 |
+## Domain allowed access. |
124 |
+## </summary> |
125 |
+## </param> |
126 |
+# |
127 |
+interface(`userdom_search_user_runtime',` |
128 |
+ gen_require(` |
129 |
+ type user_runtime_t; |
130 |
+ ') |
131 |
+ |
132 |
+ allow $1 user_runtime_t:dir search_dir_perms; |
133 |
+ userdom_search_user_runtime_root($1) |
134 |
+') |
135 |
+ |
136 |
+######################################## |
137 |
+## <summary> |
138 |
+## Search user runtime root directories. |
139 |
+## </summary> |
140 |
+## <param name="domain"> |
141 |
+## <summary> |
142 |
+## Domain allowed access. |
143 |
+## </summary> |
144 |
+## </param> |
145 |
+# |
146 |
+interface(`userdom_search_user_runtime_root',` |
147 |
+ gen_require(` |
148 |
+ type user_runtime_root_t; |
149 |
+ ') |
150 |
+ |
151 |
+ allow $1 user_runtime_root_t:dir search_dir_perms; |
152 |
+ files_search_pids($1) |
153 |
+') |
154 |
+ |
155 |
+######################################## |
156 |
+## <summary> |
157 |
## Read and write user tmpfs files. |
158 |
## </summary> |
159 |
## <param name="domain"> |