summaryrefslogtreecommitdiffstats
path: root/fs/xattr.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-08-24 18:25:39 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2018-08-24 18:25:39 +0200
commit4def1963608ed2b61aca5b52fdedb4ca2798820c (patch)
tree83b36e8ff3c5eabe0d235f863adcf54f838f838a /fs/xattr.c
parentMerge tag 'drm-next-2018-08-24' of git://anongit.freedesktop.org/drm/drm (diff)
parentgetxattr: use correct xattr length (diff)
downloadlinux-4def1963608ed2b61aca5b52fdedb4ca2798820c.tar.xz
linux-4def1963608ed2b61aca5b52fdedb4ca2798820c.zip
Merge branch 'userns-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
Pull namespace fixes from Eric Biederman: "This is a set of four fairly obvious bug fixes: - a switch from d_find_alias to d_find_any_alias because the xattr code perversely takes a dentry - two mutex vs copy_to_user fixes from Jann Horn - a fix to use a sanitized size not the size userspace passed in from Christian Brauner" * 'userns-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace: getxattr: use correct xattr length sys: don't hold uts_sem while accessing userspace memory userns: move user access out of the mutex cap_inode_getsecurity: use d_find_any_alias() instead of d_find_alias()
Diffstat (limited to 'fs/xattr.c')
-rw-r--r--fs/xattr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/xattr.c b/fs/xattr.c
index 3a24027c062d..daa732550088 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -538,7 +538,7 @@ getxattr(struct dentry *d, const char __user *name, void __user *value,
if (error > 0) {
if ((strcmp(kname, XATTR_NAME_POSIX_ACL_ACCESS) == 0) ||
(strcmp(kname, XATTR_NAME_POSIX_ACL_DEFAULT) == 0))
- posix_acl_fix_xattr_to_user(kvalue, size);
+ posix_acl_fix_xattr_to_user(kvalue, error);
if (size && copy_to_user(value, kvalue, error))
error = -EFAULT;
} else if (error == -ERANGE && size >= XATTR_SIZE_MAX) {