mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 16:35:02 +01:00
90 lines
2.9 KiB
Diff
90 lines
2.9 KiB
Diff
Index: linux-2.6.19/fs/xattr.c
|
|
===================================================================
|
|
--- linux-2.6.19.orig/fs/xattr.c
|
|
+++ linux-2.6.19/fs/xattr.c
|
|
@@ -144,18 +144,20 @@ vfs_getxattr(struct vfsmount *mnt, struc
|
|
EXPORT_SYMBOL_GPL(vfs_getxattr);
|
|
|
|
ssize_t
|
|
-vfs_listxattr(struct dentry *d, char *list, size_t size)
|
|
+vfs_listxattr(struct vfsmount *mnt, struct dentry *dentry, char *list,
|
|
+ size_t size)
|
|
{
|
|
+ struct inode *inode = dentry->d_inode;
|
|
ssize_t error;
|
|
|
|
- error = security_inode_listxattr(d);
|
|
+ error = security_inode_listxattr(dentry);
|
|
if (error)
|
|
return error;
|
|
error = -EOPNOTSUPP;
|
|
- if (d->d_inode->i_op && d->d_inode->i_op->listxattr) {
|
|
- error = d->d_inode->i_op->listxattr(d, list, size);
|
|
- } else {
|
|
- error = security_inode_listsecurity(d->d_inode, list, size);
|
|
+ if (inode->i_op && inode->i_op->listxattr)
|
|
+ error = inode->i_op->listxattr(dentry, list, size);
|
|
+ else {
|
|
+ error = security_inode_listsecurity(inode, list, size);
|
|
if (size && error > size)
|
|
error = -ERANGE;
|
|
}
|
|
@@ -362,7 +364,8 @@ sys_fgetxattr(int fd, char __user *name,
|
|
* Extended attribute LIST operations
|
|
*/
|
|
static ssize_t
|
|
-listxattr(struct dentry *d, char __user *list, size_t size)
|
|
+listxattr(struct vfsmount *mnt, struct dentry *dentry, char __user *list,
|
|
+ size_t size)
|
|
{
|
|
ssize_t error;
|
|
char *klist = NULL;
|
|
@@ -375,7 +378,7 @@ listxattr(struct dentry *d, char __user
|
|
return -ENOMEM;
|
|
}
|
|
|
|
- error = vfs_listxattr(d, klist, size);
|
|
+ error = vfs_listxattr(mnt, dentry, klist, size);
|
|
if (error > 0) {
|
|
if (size && copy_to_user(list, klist, error))
|
|
error = -EFAULT;
|
|
@@ -397,7 +400,7 @@ sys_listxattr(char __user *path, char __
|
|
error = user_path_walk(path, &nd);
|
|
if (error)
|
|
return error;
|
|
- error = listxattr(nd.dentry, list, size);
|
|
+ error = listxattr(nd.mnt, nd.dentry, list, size);
|
|
path_release(&nd);
|
|
return error;
|
|
}
|
|
@@ -411,7 +414,7 @@ sys_llistxattr(char __user *path, char _
|
|
error = user_path_walk_link(path, &nd);
|
|
if (error)
|
|
return error;
|
|
- error = listxattr(nd.dentry, list, size);
|
|
+ error = listxattr(nd.mnt, nd.dentry, list, size);
|
|
path_release(&nd);
|
|
return error;
|
|
}
|
|
@@ -425,7 +428,7 @@ sys_flistxattr(int fd, char __user *list
|
|
f = fget(fd);
|
|
if (!f)
|
|
return error;
|
|
- error = listxattr(f->f_dentry, list, size);
|
|
+ error = listxattr(f->f_vfsmnt, f->f_dentry, list, size);
|
|
fput(f);
|
|
return error;
|
|
}
|
|
Index: linux-2.6.19/include/linux/xattr.h
|
|
===================================================================
|
|
--- linux-2.6.19.orig/include/linux/xattr.h
|
|
+++ linux-2.6.19/include/linux/xattr.h
|
|
@@ -42,7 +42,7 @@ struct xattr_handler {
|
|
|
|
ssize_t vfs_getxattr(struct vfsmount *, struct dentry *, char *, void *,
|
|
size_t);
|
|
-ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size);
|
|
+ssize_t vfs_listxattr(struct vfsmount *, struct dentry *, char *, size_t);
|
|
int vfs_setxattr(struct vfsmount *, struct dentry *, char *, void *, size_t,
|
|
int);
|
|
int vfs_removexattr(struct dentry *, char *);
|