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/
Date: Thu, 02 Jun 2016 06:32:22
Message-Id: 1464805207.0d320152aa69e147c6da94d13ab929db3f070e78.perfinion@gentoo
1 commit: 0d320152aa69e147c6da94d13ab929db3f070e78
2 Author: Jason Zaman <jason <AT> perfinion <DOT> com>
3 AuthorDate: Wed Jun 1 16:08:56 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=0d320152
7
8 userdomain: introduce interfaces for user runtime
9
10 policy/modules/system/userdomain.if | 206 ++++++++++++++++++++++++++++++++++++
11 1 file changed, 206 insertions(+)
12
13 diff --git a/policy/modules/system/userdomain.if b/policy/modules/system/userdomain.if
14 index 14dae15..beed625 100644
15 --- a/policy/modules/system/userdomain.if
16 +++ b/policy/modules/system/userdomain.if
17 @@ -324,6 +324,7 @@ interface(`userdom_manage_tmp_role',`
18 manage_sock_files_pattern($2, user_tmp_t, user_tmp_t)
19 manage_fifo_files_pattern($2, user_tmp_t, user_tmp_t)
20 files_tmp_filetrans($2, user_tmp_t, { dir file lnk_file sock_file fifo_file })
21 + userdom_user_runtime_filetrans_user_tmp($2, { dir file lnk_file sock_file fifo_file })
22 ')
23
24 #######################################
25 @@ -2768,6 +2769,211 @@ interface(`userdom_search_user_runtime_root',`
26
27 ########################################
28 ## <summary>
29 +## Create, read, write, and delete user
30 +## runtime root dirs.
31 +## </summary>
32 +## <param name="domain">
33 +## <summary>
34 +## Domain allowed access.
35 +## </summary>
36 +## </param>
37 +#
38 +interface(`userdom_manage_user_runtime_root_dirs',`
39 + gen_require(`
40 + type user_runtime_root_t;
41 + ')
42 +
43 + allow $1 user_runtime_root_t:dir manage_dir_perms;
44 + files_search_pids($1)
45 +')
46 +
47 +########################################
48 +## <summary>
49 +## Create, read, write, and delete user
50 +## runtime dirs.
51 +## </summary>
52 +## <param name="domain">
53 +## <summary>
54 +## Domain allowed access.
55 +## </summary>
56 +## </param>
57 +#
58 +interface(`userdom_manage_user_runtime_dirs',`
59 + gen_require(`
60 + type user_runtime_t;
61 + ')
62 +
63 + allow $1 user_runtime_t:dir manage_dir_perms;
64 + userdom_search_user_runtime_root($1)
65 +')
66 +
67 +########################################
68 +## <summary>
69 +## Mount a filesystem on user runtime dir
70 +## directories.
71 +## </summary>
72 +## <param name="domain">
73 +## <summary>
74 +## Domain allowed access.
75 +## </summary>
76 +## </param>
77 +#
78 +interface(`userdom_mounton_user_runtime_dirs',`
79 + gen_require(`
80 + type user_runtime_t;
81 + ')
82 +
83 + allow $1 user_runtime_t:dir mounton;
84 +')
85 +
86 +########################################
87 +## <summary>
88 +## Relabel to user runtime directories.
89 +## </summary>
90 +## <param name="domain">
91 +## <summary>
92 +## Domain allowed access.
93 +## </summary>
94 +## </param>
95 +#
96 +interface(`userdom_relabelto_user_runtime_dirs',`
97 + gen_require(`
98 + type user_runtime_t;
99 + ')
100 +
101 + allow $1 user_runtime_t:dir relabelto;
102 +')
103 +
104 +########################################
105 +## <summary>
106 +## Create objects in the pid directory
107 +## with an automatic type transition to
108 +## the user runtime root type.
109 +## </summary>
110 +## <param name="domain">
111 +## <summary>
112 +## Domain allowed access.
113 +## </summary>
114 +## </param>
115 +## <param name="object_class">
116 +## <summary>
117 +## The class of the object to be created.
118 +## </summary>
119 +## </param>
120 +## <param name="name" optional="true">
121 +## <summary>
122 +## The name of the object being created.
123 +## </summary>
124 +## </param>
125 +#
126 +interface(`userdom_pid_filetrans_user_runtime_root',`
127 + gen_require(`
128 + type user_runtime_root_t;
129 + ')
130 +
131 + files_pid_filetrans($1, user_runtime_root_t, $2, $3)
132 +')
133 +
134 +########################################
135 +## <summary>
136 +## Create objects in a user runtime
137 +## directory with an automatic type
138 +## transition to a specified private
139 +## type.
140 +## </summary>
141 +## <param name="domain">
142 +## <summary>
143 +## Domain allowed access.
144 +## </summary>
145 +## </param>
146 +## <param name="private_type">
147 +## <summary>
148 +## The type of the object to create.
149 +## </summary>
150 +## </param>
151 +## <param name="object_class">
152 +## <summary>
153 +## The class of the object to be created.
154 +## </summary>
155 +## </param>
156 +## <param name="name" optional="true">
157 +## <summary>
158 +## The name of the object being created.
159 +## </summary>
160 +## </param>
161 +#
162 +interface(`userdom_user_runtime_filetrans',`
163 + gen_require(`
164 + type user_runtime_root_t, user_runtime_t;
165 + ')
166 +
167 + filetrans_pattern($1, user_runtime_t, $2, $3, $4)
168 + userdom_search_user_runtime_root($1)
169 +')
170 +
171 +########################################
172 +## <summary>
173 +## Create objects in the user runtime directory
174 +## with an automatic type transition to
175 +## the user temporary type.
176 +## </summary>
177 +## <param name="domain">
178 +## <summary>
179 +## Domain allowed access.
180 +## </summary>
181 +## </param>
182 +## <param name="object_class">
183 +## <summary>
184 +## The class of the object to be created.
185 +## </summary>
186 +## </param>
187 +## <param name="name" optional="true">
188 +## <summary>
189 +## The name of the object being created.
190 +## </summary>
191 +## </param>
192 +#
193 +interface(`userdom_user_runtime_filetrans_user_tmp',`
194 + gen_require(`
195 + type user_tmp_t;
196 + ')
197 +
198 + userdom_user_runtime_filetrans($1, user_tmp_t, $2, $3)
199 +')
200 +
201 +########################################
202 +## <summary>
203 +## Create objects in the user runtime root
204 +## directory with an automatic type transition
205 +## to the user runtime dir type.
206 +## </summary>
207 +## <param name="domain">
208 +## <summary>
209 +## Domain allowed access.
210 +## </summary>
211 +## </param>
212 +## <param name="object_class">
213 +## <summary>
214 +## The class of the object to be created.
215 +## </summary>
216 +## </param>
217 +## <param name="name" optional="true">
218 +## <summary>
219 +## The name of the object being created.
220 +## </summary>
221 +## </param>
222 +#
223 +interface(`userdom_user_runtime_root_filetrans_user_runtime',`
224 + gen_require(`
225 + type user_runtime_root_t, user_runtime_t;
226 + ')
227 +
228 + filetrans_pattern($1, user_runtime_root_t, user_runtime_t, $2, $3)
229 + files_search_pids($1)
230 +')
231 +
232 +########################################
233 +## <summary>
234 ## Read and write user tmpfs files.
235 ## </summary>
236 ## <param name="domain">