~sbeattie/apparmor/apparmor-ubuntu-2.6.1-merge

« back to all changes in this revision

Viewing changes to deprecated/kernel-patches/2.6.27/fix-vfs_rmdir.diff

  • Committer: Jamie Strandboge
  • Date: 2011-02-24 18:04:26 UTC
  • mfrom: (1415.3.4 apparmor-ubuntu-trunk)
  • Revision ID: jamie@canonical.com-20110224180426-q39kzcgsktwx8ixj
Released 2.6.0-0ubuntu1 to natty

[ Steve Beattie ]
* New upstream 2.6.0 release (LP: #724193)
  - Patches taken upstream and dropped:
    + 0001-ubuntu-buildd.patch
    + 0003-add-libvirt-support-to-dnsmasq.patch
    + 0004-lp698194.patch
    + 0005-aa-disable.patch
  - debian/rules: remove library path settings for mod_apparmor and
    pam_apprmor builds; upstream handles this properly now.
  - debian/apparmor-utils.install: handle upstream SubDomain.pm =>
    AppArmor.pm renaming
* debian/lib/apparmor/functions: handle profile names with embedded
  spaces (LP: #655523)
* debian/rules, debian/control, debian/python-libapparmor: build
  a python-libapparmor package.
[ Jamie Strandboge ]
* debian/control: use Section: python for python-libapparmor

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
From: John Johansen <jjohansen@suse.de>
2
 
Subject: Call lsm hook before unhashing dentry in vfs_rmdir()
3
 
 
4
 
If we unhash the dentry before calling the security_inode_rmdir hook,
5
 
we cannot compute the file's pathname in the hook anymore. AppArmor
6
 
needs to know the filename in order to decide whether a file may be
7
 
deleted, though.
8
 
 
9
 
Signed-off-by: John Johansen <jjohansen@suse.de>
10
 
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
11
 
 
12
 
---
13
 
 fs/namei.c |   13 +++++++------
14
 
 1 file changed, 7 insertions(+), 6 deletions(-)
15
 
 
16
 
--- a/fs/namei.c
17
 
+++ b/fs/namei.c
18
 
@@ -2146,6 +2146,10 @@ int vfs_rmdir(struct inode *dir, struct
19
 
        if (!dir->i_op || !dir->i_op->rmdir)
20
 
                return -EPERM;
21
 
 
22
 
+       error = security_inode_rmdir(dir, dentry, mnt);
23
 
+       if (error)
24
 
+               return error;
25
 
+
26
 
        DQUOT_INIT(dir);
27
 
 
28
 
        mutex_lock(&dentry->d_inode->i_mutex);
29
 
@@ -2153,12 +2157,9 @@ int vfs_rmdir(struct inode *dir, struct
30
 
        if (d_mountpoint(dentry))
31
 
                error = -EBUSY;
32
 
        else {
33
 
-               error = security_inode_rmdir(dir, dentry, mnt);
34
 
-               if (!error) {
35
 
-                       error = dir->i_op->rmdir(dir, dentry);
36
 
-                       if (!error)
37
 
-                               dentry->d_inode->i_flags |= S_DEAD;
38
 
-               }
39
 
+               error = dir->i_op->rmdir(dir, dentry);
40
 
+               if (!error)
41
 
+                       dentry->d_inode->i_flags |= S_DEAD;
42
 
        }
43
 
        mutex_unlock(&dentry->d_inode->i_mutex);
44
 
        if (!error) {