~ubuntu-branches/ubuntu/raring/apparmor/raring

« back to all changes in this revision

Viewing changes to kernel-patches/for-mainline/fix-deleted-revalidation.diff

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook
  • Date: 2007-03-23 16:42:01 UTC
  • Revision ID: james.westby@ubuntu.com-20070323164201-jkax6f0oku087b7l
Tags: upstream-2.0.1+510.dfsg
ImportĀ upstreamĀ versionĀ 2.0.1+510.dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Index: b/security/apparmor/main.c
 
2
===================================================================
 
3
--- a/security/apparmor/main.c
 
4
+++ b/security/apparmor/main.c
 
5
@@ -198,7 +198,11 @@ static int aa_perm_dentry(struct aa_prof
 
6
        sa->name = aa_get_name(dentry, mnt, &buffer, is_dir);
 
7
 
 
8
        if (IS_ERR(sa->name)) {
 
9
-               denied_mask = PTR_ERR(sa->name);
 
10
+               /* deleted files are given a pass on permission checks */
 
11
+               if (PTR_ERR(sa->name) == -ENOENT)
 
12
+                       denied_mask = 0;
 
13
+               else
 
14
+                       denied_mask = PTR_ERR(sa->name);
 
15
                sa->name = NULL;
 
16
        } else {
 
17
                denied_mask = aa_file_denied(profile, sa->name, mask);