diff options
Diffstat (limited to 'security/tomoyo/mount.c')
-rw-r--r-- | security/tomoyo/mount.c | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/security/tomoyo/mount.c b/security/tomoyo/mount.c index 507be09e93a9..aeac619f787d 100644 --- a/security/tomoyo/mount.c +++ b/security/tomoyo/mount.c | |||
@@ -178,19 +178,12 @@ static int tomoyo_mount_acl2(struct tomoyo_request_info *r, char *dev_name, | |||
178 | error = 0; | 178 | error = 0; |
179 | break; | 179 | break; |
180 | } | 180 | } |
181 | if (error) { | 181 | if (error) |
182 | const char *dev = tomoyo_get_file_pattern(&rdev)->name; | 182 | error = tomoyo_supervisor(r, TOMOYO_KEYWORD_ALLOW_MOUNT |
183 | const char *dir = tomoyo_get_file_pattern(&rdir)->name; | 183 | "%s %s %s 0x%lX\n", |
184 | int len = strlen(dev) + strlen(dir) + strlen(requested_type) | 184 | tomoyo_file_pattern(&rdev), |
185 | + 64; | 185 | tomoyo_file_pattern(&rdir), |
186 | char *buf = kzalloc(len, GFP_NOFS); | 186 | requested_type, flags); |
187 | if (buf) { | ||
188 | snprintf(buf, len - 1, "%s %s %s 0x%lX", | ||
189 | dev, dir, requested_type, flags); | ||
190 | tomoyo_write_mount_policy(buf, r->domain, false); | ||
191 | kfree(buf); | ||
192 | } | ||
193 | } | ||
194 | out: | 187 | out: |
195 | kfree(requested_dev_name); | 188 | kfree(requested_dev_name); |
196 | kfree(requested_dir_name); | 189 | kfree(requested_dir_name); |
@@ -279,7 +272,10 @@ static int tomoyo_mount_acl(struct tomoyo_request_info *r, char *dev_name, | |||
279 | TOMOYO_MOUNT_MAKE_SHARED_KEYWORD, | 272 | TOMOYO_MOUNT_MAKE_SHARED_KEYWORD, |
280 | flags & ~MS_SHARED); | 273 | flags & ~MS_SHARED); |
281 | else | 274 | else |
282 | error = tomoyo_mount_acl2(r, dev_name, dir, type, flags); | 275 | do { |
276 | error = tomoyo_mount_acl2(r, dev_name, dir, type, | ||
277 | flags); | ||
278 | } while (error == TOMOYO_RETRY_REQUEST); | ||
283 | if (r->mode != TOMOYO_CONFIG_ENFORCING) | 279 | if (r->mode != TOMOYO_CONFIG_ENFORCING) |
284 | error = 0; | 280 | error = 0; |
285 | return error; | 281 | return error; |