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

« back to all changes in this revision

Viewing changes to deprecated/kernel-patches/2.6.28/vfs-listxattr.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: Tony Jones <tonyj@suse.de>
2
 
Subject: Add a struct vfsmount parameter to vfs_listxattr()
3
 
 
4
 
The vfsmount will be passed down to the LSM hook so that LSMs can compute
5
 
pathnames.
6
 
 
7
 
Signed-off-by: Tony Jones <tonyj@suse.de>
8
 
Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
9
 
Signed-off-by: John Johansen <jjohansen@suse.de>
10
 
 
11
 
---
12
 
 fs/xattr.c            |   25 ++++++++++++++-----------
13
 
 include/linux/xattr.h |    2 +-
14
 
 2 files changed, 15 insertions(+), 12 deletions(-)
15
 
 
16
 
--- a/fs/xattr.c
17
 
+++ b/fs/xattr.c
18
 
@@ -168,18 +168,20 @@ nolsm:
19
 
 EXPORT_SYMBOL_GPL(vfs_getxattr);
20
 
 
21
 
 ssize_t
22
 
-vfs_listxattr(struct dentry *d, char *list, size_t size)
23
 
+vfs_listxattr(struct dentry *dentry, struct vfsmount *mnt, char *list,
24
 
+             size_t size)
25
 
 {
26
 
+       struct inode *inode = dentry->d_inode;
27
 
        ssize_t error;
28
 
 
29
 
-       error = security_inode_listxattr(d);
30
 
+       error = security_inode_listxattr(dentry);
31
 
        if (error)
32
 
                return error;
33
 
        error = -EOPNOTSUPP;
34
 
-       if (d->d_inode->i_op && d->d_inode->i_op->listxattr) {
35
 
-               error = d->d_inode->i_op->listxattr(d, list, size);
36
 
-       } else {
37
 
-               error = security_inode_listsecurity(d->d_inode, list, size);
38
 
+       if (inode->i_op && inode->i_op->listxattr)
39
 
+               error = inode->i_op->listxattr(dentry, list, size);
40
 
+       else {
41
 
+               error = security_inode_listsecurity(inode, list, size);
42
 
                if (size && error > size)
43
 
                        error = -ERANGE;
44
 
        }
45
 
@@ -399,7 +401,8 @@ sys_fgetxattr(int fd, const char __user
46
 
  * Extended attribute LIST operations
47
 
  */
48
 
 static ssize_t
49
 
-listxattr(struct dentry *d, char __user *list, size_t size)
50
 
+listxattr(struct dentry *dentry, struct vfsmount *mnt, char __user *list,
51
 
+         size_t size)
52
 
 {
53
 
        ssize_t error;
54
 
        char *klist = NULL;
55
 
@@ -412,7 +415,7 @@ listxattr(struct dentry *d, char __user
56
 
                        return -ENOMEM;
57
 
        }
58
 
 
59
 
-       error = vfs_listxattr(d, klist, size);
60
 
+       error = vfs_listxattr(dentry, mnt, klist, size);
61
 
        if (error > 0) {
62
 
                if (size && copy_to_user(list, klist, error))
63
 
                        error = -EFAULT;
64
 
@@ -434,7 +437,7 @@ sys_listxattr(const char __user *pathnam
65
 
        error = user_path(pathname, &path);
66
 
        if (error)
67
 
                return error;
68
 
-       error = listxattr(path.dentry, list, size);
69
 
+       error = listxattr(path.dentry, path.mnt, list, size);
70
 
        path_put(&path);
71
 
        return error;
72
 
 }
73
 
@@ -448,7 +451,7 @@ sys_llistxattr(const char __user *pathna
74
 
        error = user_lpath(pathname, &path);
75
 
        if (error)
76
 
                return error;
77
 
-       error = listxattr(path.dentry, list, size);
78
 
+       error = listxattr(path.dentry, path.mnt, list, size);
79
 
        path_put(&path);
80
 
        return error;
81
 
 }
82
 
@@ -463,7 +466,7 @@ sys_flistxattr(int fd, char __user *list
83
 
        if (!f)
84
 
                return error;
85
 
        audit_inode(NULL, f->f_path.dentry);
86
 
-       error = listxattr(f->f_path.dentry, list, size);
87
 
+       error = listxattr(f->f_path.dentry, f->f_path.mnt, list, size);
88
 
        fput(f);
89
 
        return error;
90
 
 }
91
 
--- a/include/linux/xattr.h
92
 
+++ b/include/linux/xattr.h
93
 
@@ -49,7 +49,7 @@ struct xattr_handler {
94
 
 
95
 
 ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t);
96
 
 ssize_t vfs_getxattr(struct dentry *, struct vfsmount *, const char *, void *, size_t);
97
 
-ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size);
98
 
+ssize_t vfs_listxattr(struct dentry *d, struct vfsmount *, char *list, size_t size);
99
 
 int vfs_setxattr(struct dentry *, struct vfsmount *, const char *, const void *, size_t, int);
100
 
 int vfs_removexattr(struct dentry *, const char *);
101