~ubuntu-branches/ubuntu/lucid/apparmor/lucid-proposed

« back to all changes in this revision

Viewing changes to kernel-patches/2.6.24/fix-vfs_rmdir.diff

  • Committer: Bazaar Package Importer
  • Author(s): Jamie Strandboge
  • Date: 2010-11-02 13:33:15 UTC
  • mfrom: (99.1.11 maverick-proposed)
  • Revision ID: james.westby@ubuntu.com-20101102133315-jcil3cqqiz6lr0km
Tags: 2.5.1-0ubuntu0.10.04.1
* Backport 2.5.1-0ubuntu0.10.10.1 from maverick for userspace tools to work
  with newer kernels (LP: #660077)
  NOTE: user-tmp now uses 'owner' match, so non-default profiles will have
  to be adjusted when 2 separately confined applications that both use the
  user-tmp abstraction depend on being able to cooperatively share files
  with each other in /tmp or /var/tmp.
* remove the following patches (features not appropriate for SRU):
  - 0002-add-chromium-browser.patch
  - 0003-local-includes.patch
  - 0004-ubuntu-abstractions-updates.patch
* debian/rules (this makes it the same as what was shipped in 10.04 LTS
  release):
  - don't ship aa-update-browser and its man page (requires
    0004-ubuntu-abstractions-updates.patch)
  - don't ship apparmor.d/local/ (requires 0003-local-includes.patch)
  - don't use dh_apparmor (not in Ubuntu 10.04 LTS)
  - don't ship chromium profile
* remove debian/profiles/chromium-browser
* remove debian/aa-update-browser*
* debian/apparmor-profiles.postinst: revert to that in lucid release
  (requires dh_apparmor and 0002-add-chromium-browser.patch)
* remove debian/apparmor-profiles.postrm: doesn't make sense without
  0002-add-chromium-browser.patch
* debian/control:
  - revert Build-Depends on debhelper (>= 5)
  - revert Standards-Version to 3.8.4
  - revert Vcs-Bzr
  - use Conflicts/Replaces version that was in Ubuntu 10.04 LTS
* debian/patches/0011-lucid-compat-dbus.patch: move /var/lib/dbus/machine-id
  back into dbus, since profiles on 10.04 LTS expect it there
* debian/patches/0012-lucid-compat-kde.patch: add kde4-config to kde
  abstraction, since the firefox profile on Ubuntu 10.04 LTS expects it to
  be there

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
 
@@ -2097,6 +2097,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
 
@@ -2104,12 +2108,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) {