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

« back to all changes in this revision

Viewing changes to kernel-patches/2.6.26/security-getxattr.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: Tony Jones <tonyj@suse.de>
2
 
Subject: Pass struct vfsmount to the inode_getxattr LSM hook
3
 
 
4
 
This is needed for computing pathnames in the AppArmor LSM.
5
 
 
6
 
Signed-off-by: Tony Jones <tonyj@suse.de>
7
 
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
8
 
Signed-off-by: John Johansen <jjohansen@suse.de>
9
 
 
10
 
---
11
 
 fs/xattr.c               |    2 +-
12
 
 include/linux/security.h |   11 +++++++----
13
 
 security/dummy.c         |    3 ++-
14
 
 security/security.c      |    5 +++--
15
 
 security/selinux/hooks.c |    3 ++-
16
 
 5 files changed, 15 insertions(+), 9 deletions(-)
17
 
 
18
 
--- a/fs/xattr.c
19
 
+++ b/fs/xattr.c
20
 
@@ -141,7 +141,7 @@ vfs_getxattr(struct dentry *dentry, stru
21
 
        if (error)
22
 
                return error;
23
 
 
24
 
-       error = security_inode_getxattr(dentry, name);
25
 
+       error = security_inode_getxattr(dentry, mnt, name);
26
 
        if (error)
27
 
                return error;
28
 
 
29
 
--- a/include/linux/security.h
30
 
+++ b/include/linux/security.h
31
 
@@ -450,7 +450,7 @@ static inline void security_free_mnt_opt
32
 
  *     @value identified by @name for @dentry and @mnt.
33
 
  * @inode_getxattr:
34
 
  *     Check permission before obtaining the extended attributes
35
 
- *     identified by @name for @dentry.
36
 
+ *     identified by @name for @dentry and @mnt.
37
 
  *     Return 0 if permission is granted.
38
 
  * @inode_listxattr:
39
 
  *     Check permission before obtaining the list of extended attribute
40
 
@@ -1401,7 +1401,8 @@ struct security_operations {
41
 
                                     struct vfsmount *mnt,
42
 
                                     const char *name, const void *value,
43
 
                                     size_t size, int flags);
44
 
-       int (*inode_getxattr) (struct dentry *dentry, const char *name);
45
 
+       int (*inode_getxattr) (struct dentry *dentry, struct vfsmount *mnt,
46
 
+                              const char *name);
47
 
        int (*inode_listxattr) (struct dentry *dentry);
48
 
        int (*inode_removexattr) (struct dentry *dentry, const char *name);
49
 
        int (*inode_need_killpriv) (struct dentry *dentry);
50
 
@@ -1682,7 +1683,8 @@ int security_inode_setxattr(struct dentr
51
 
 void security_inode_post_setxattr(struct dentry *dentry, struct vfsmount *mnt,
52
 
                                  const char *name, const void *value,
53
 
                                  size_t size, int flags);
54
 
-int security_inode_getxattr(struct dentry *dentry, const char *name);
55
 
+int security_inode_getxattr(struct dentry *dentry, struct vfsmount *mnt,
56
 
+                           const char *name);
57
 
 int security_inode_listxattr(struct dentry *dentry);
58
 
 int security_inode_removexattr(struct dentry *dentry, const char *name);
59
 
 int security_inode_need_killpriv(struct dentry *dentry);
60
 
@@ -2114,7 +2116,8 @@ static inline void security_inode_post_s
61
 
 { }
62
 
 
63
 
 static inline int security_inode_getxattr(struct dentry *dentry,
64
 
-                       const char *name)
65
 
+                                         struct vfsmount *mnt,
66
 
+                                         const char *name)
67
 
 {
68
 
        return 0;
69
 
 }
70
 
--- a/security/dummy.c
71
 
+++ b/security/dummy.c
72
 
@@ -392,7 +392,8 @@ static void dummy_inode_post_setxattr (s
73
 
 {
74
 
 }
75
 
 
76
 
-static int dummy_inode_getxattr (struct dentry *dentry, const char *name)
77
 
+static int dummy_inode_getxattr (struct dentry *dentry, struct vfsmount *mnt,
78
 
+                                const char *name)
79
 
 {
80
 
        return 0;
81
 
 }
82
 
--- a/security/security.c
83
 
+++ b/security/security.c
84
 
@@ -520,11 +520,12 @@ void security_inode_post_setxattr(struct
85
 
                                          flags);
86
 
 }
87
 
 
88
 
-int security_inode_getxattr(struct dentry *dentry, const char *name)
89
 
+int security_inode_getxattr(struct dentry *dentry, struct vfsmount *mnt,
90
 
+                           const char *name)
91
 
 {
92
 
        if (unlikely(IS_PRIVATE(dentry->d_inode)))
93
 
                return 0;
94
 
-       return security_ops->inode_getxattr(dentry, name);
95
 
+       return security_ops->inode_getxattr(dentry, mnt, name);
96
 
 }
97
 
 
98
 
 int security_inode_listxattr(struct dentry *dentry)
99
 
--- a/security/selinux/hooks.c
100
 
+++ b/security/selinux/hooks.c
101
 
@@ -2732,7 +2732,8 @@ static void selinux_inode_post_setxattr(
102
 
        return;
103
 
 }
104
 
 
105
 
-static int selinux_inode_getxattr(struct dentry *dentry, const char *name)
106
 
+static int selinux_inode_getxattr(struct dentry *dentry, struct vfsmount *mnt,
107
 
+                                 const char *name)
108
 
 {
109
 
        return dentry_has_perm(current, NULL, dentry, FILE__GETATTR);
110
 
 }