diff options
author | James Morris <james.l.morris@oracle.com> | 2012-03-14 23:43:02 -0400 |
---|---|---|
committer | James Morris <james.l.morris@oracle.com> | 2012-03-14 23:43:02 -0400 |
commit | b01d3fb921df9baef1ecd13704f4b1e269b58b6b (patch) | |
tree | 1ca714b40774cd56c0194abee5c6577b2ba6aad2 /security/apparmor/file.c | |
parent | 6041e8346f2165679c2184cab60db768d6a26a1d (diff) | |
parent | 2d4cee7e3a2b9f9c3237672cc136e20dbad0e2ce (diff) |
Merge branch 'for-security' of git://git.kernel.org/pub/scm/linux/kernel/git/jj/linux-apparmor into next
Diffstat (limited to 'security/apparmor/file.c')
-rw-r--r-- | security/apparmor/file.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/security/apparmor/file.c b/security/apparmor/file.c index bba875c4d06..3022c0f4f0d 100644 --- a/security/apparmor/file.c +++ b/security/apparmor/file.c | |||
@@ -278,22 +278,16 @@ int aa_path_perm(int op, struct aa_profile *profile, struct path *path, | |||
278 | int error; | 278 | int error; |
279 | 279 | ||
280 | flags |= profile->path_flags | (S_ISDIR(cond->mode) ? PATH_IS_DIR : 0); | 280 | flags |= profile->path_flags | (S_ISDIR(cond->mode) ? PATH_IS_DIR : 0); |
281 | error = aa_get_name(path, flags, &buffer, &name); | 281 | error = aa_path_name(path, flags, &buffer, &name, &info); |
282 | if (error) { | 282 | if (error) { |
283 | if (error == -ENOENT && is_deleted(path->dentry)) { | 283 | if (error == -ENOENT && is_deleted(path->dentry)) { |
284 | /* Access to open files that are deleted are | 284 | /* Access to open files that are deleted are |
285 | * give a pass (implicit delegation) | 285 | * give a pass (implicit delegation) |
286 | */ | 286 | */ |
287 | error = 0; | 287 | error = 0; |
288 | info = NULL; | ||
288 | perms.allow = request; | 289 | perms.allow = request; |
289 | } else if (error == -ENOENT) | 290 | } |
290 | info = "Failed name lookup - deleted entry"; | ||
291 | else if (error == -ESTALE) | ||
292 | info = "Failed name lookup - disconnected path"; | ||
293 | else if (error == -ENAMETOOLONG) | ||
294 | info = "Failed name lookup - name too long"; | ||
295 | else | ||
296 | info = "Failed name lookup"; | ||
297 | } else { | 291 | } else { |
298 | aa_str_perms(profile->file.dfa, profile->file.start, name, cond, | 292 | aa_str_perms(profile->file.dfa, profile->file.start, name, cond, |
299 | &perms); | 293 | &perms); |
@@ -364,12 +358,14 @@ int aa_path_link(struct aa_profile *profile, struct dentry *old_dentry, | |||
364 | lperms = nullperms; | 358 | lperms = nullperms; |
365 | 359 | ||
366 | /* buffer freed below, lname is pointer in buffer */ | 360 | /* buffer freed below, lname is pointer in buffer */ |
367 | error = aa_get_name(&link, profile->path_flags, &buffer, &lname); | 361 | error = aa_path_name(&link, profile->path_flags, &buffer, &lname, |
362 | &info); | ||
368 | if (error) | 363 | if (error) |
369 | goto audit; | 364 | goto audit; |
370 | 365 | ||
371 | /* buffer2 freed below, tname is pointer in buffer2 */ | 366 | /* buffer2 freed below, tname is pointer in buffer2 */ |
372 | error = aa_get_name(&target, profile->path_flags, &buffer2, &tname); | 367 | error = aa_path_name(&target, profile->path_flags, &buffer2, &tname, |
368 | &info); | ||
373 | if (error) | 369 | if (error) |
374 | goto audit; | 370 | goto audit; |
375 | 371 | ||