]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/suse-2.6.27.31/patches.apparmor/vfs-removexattr.diff
Revert "Disable build of xen kernel."
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.apparmor / vfs-removexattr.diff
1 From: Tony Jones <tonyj@suse.de>
2 Subject: Add a struct vfsmount parameter to vfs_removexattr()
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/nfsd/vfs.c | 11 ++++++-----
13 fs/xattr.c | 12 ++++++------
14 include/linux/xattr.h | 2 +-
15 3 files changed, 13 insertions(+), 12 deletions(-)
16
17 --- linux-2.6.27.orig/fs/nfsd/vfs.c
18 +++ linux-2.6.27/fs/nfsd/vfs.c
19 @@ -2095,6 +2095,7 @@ nfsd_get_posix_acl(struct svc_fh *fhp, i
20 int
21 nfsd_set_posix_acl(struct svc_fh *fhp, int type, struct posix_acl *acl)
22 {
23 + struct vfsmount *mnt;
24 struct inode *inode = fhp->fh_dentry->d_inode;
25 char *name;
26 void *value = NULL;
27 @@ -2127,22 +2128,22 @@ nfsd_set_posix_acl(struct svc_fh *fhp, i
28 } else
29 size = 0;
30
31 - error = mnt_want_write(fhp->fh_export->ex_path.mnt);
32 + mnt = fhp->fh_export->ex_path.mnt;
33 + error = mnt_want_write(mnt);
34 if (error)
35 goto getout;
36 if (size)
37 - error = vfs_setxattr(fhp->fh_dentry, fhp->fh_export->ex_path.mnt,
38 - name, value, size,0);
39 + error = vfs_setxattr(fhp->fh_dentry, mnt, name, value, size,0);
40 else {
41 if (!S_ISDIR(inode->i_mode) && type == ACL_TYPE_DEFAULT)
42 error = 0;
43 else {
44 - error = vfs_removexattr(fhp->fh_dentry, name);
45 + error = vfs_removexattr(fhp->fh_dentry, mnt, name);
46 if (error == -ENODATA)
47 error = 0;
48 }
49 }
50 - mnt_drop_write(fhp->fh_export->ex_path.mnt);
51 + mnt_drop_write(mnt);
52
53 getout:
54 kfree(value);
55 --- linux-2.6.27.orig/fs/xattr.c
56 +++ linux-2.6.27/fs/xattr.c
57 @@ -190,7 +190,7 @@ vfs_listxattr(struct dentry *dentry, str
58 EXPORT_SYMBOL_GPL(vfs_listxattr);
59
60 int
61 -vfs_removexattr(struct dentry *dentry, const char *name)
62 +vfs_removexattr(struct dentry *dentry, struct vfsmount *mnt, const char *name)
63 {
64 struct inode *inode = dentry->d_inode;
65 int error;
66 @@ -471,7 +471,7 @@ SYSCALL_DEFINE3(flistxattr, int, fd, cha
67 * Extended attribute REMOVE operations
68 */
69 static long
70 -removexattr(struct dentry *d, const char __user *name)
71 +removexattr(struct dentry *dentry, struct vfsmount *mnt, const char __user *name)
72 {
73 int error;
74 char kname[XATTR_NAME_MAX + 1];
75 @@ -482,7 +482,7 @@ removexattr(struct dentry *d, const char
76 if (error < 0)
77 return error;
78
79 - return vfs_removexattr(d, kname);
80 + return vfs_removexattr(dentry, mnt, kname);
81 }
82
83 SYSCALL_DEFINE2(removexattr, const char __user *, pathname,
84 @@ -496,7 +496,7 @@ SYSCALL_DEFINE2(removexattr, const char
85 return error;
86 error = mnt_want_write(path.mnt);
87 if (!error) {
88 - error = removexattr(path.dentry, name);
89 + error = removexattr(path.dentry, path.mnt, name);
90 mnt_drop_write(path.mnt);
91 }
92 path_put(&path);
93 @@ -514,7 +514,7 @@ SYSCALL_DEFINE2(lremovexattr, const char
94 return error;
95 error = mnt_want_write(path.mnt);
96 if (!error) {
97 - error = removexattr(path.dentry, name);
98 + error = removexattr(path.dentry, path.mnt, name);
99 mnt_drop_write(path.mnt);
100 }
101 path_put(&path);
102 @@ -534,7 +534,7 @@ SYSCALL_DEFINE2(fremovexattr, int, fd, c
103 audit_inode(NULL, dentry);
104 error = mnt_want_write_file(f->f_path.mnt, f);
105 if (!error) {
106 - error = removexattr(dentry, name);
107 + error = removexattr(dentry, f->f_path.mnt, name);
108 mnt_drop_write(f->f_path.mnt);
109 }
110 fput(f);
111 --- linux-2.6.27.orig/include/linux/xattr.h
112 +++ linux-2.6.27/include/linux/xattr.h
113 @@ -51,7 +51,7 @@ ssize_t xattr_getsecurity(struct inode *
114 ssize_t vfs_getxattr(struct dentry *, struct vfsmount *, const char *, void *, size_t);
115 ssize_t vfs_listxattr(struct dentry *d, struct vfsmount *, char *list, size_t size);
116 int vfs_setxattr(struct dentry *, struct vfsmount *, const char *, const void *, size_t, int);
117 -int vfs_removexattr(struct dentry *, const char *);
118 +int vfs_removexattr(struct dentry *, struct vfsmount *mnt, const char *);
119
120 ssize_t generic_getxattr(struct dentry *dentry, const char *name, void *buffer, size_t size);
121 ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size);