From: Miklos Szeredi Date: Tue, 10 Nov 2015 16:08:41 +0000 (+0100) Subject: ovl: allow zero size xattr X-Git-Tag: firefly_0821_release~3308^2~15 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=85a7ed329aca5efd0eb70789db145a1e989c7a53;p=firefly-linux-kernel-4.4.55.git ovl: allow zero size xattr commit 97daf8b97ad6f913a34c82515be64dc9ac08d63e upstream. When ovl_copy_xattr() encountered a zero size xattr no more xattrs were copied and the function returned success. This is clearly not the desired behavior. Signed-off-by: Miklos Szeredi Signed-off-by: Greg Kroah-Hartman --- diff --git a/fs/overlayfs/copy_up.c b/fs/overlayfs/copy_up.c index 0a8983492d91..927cb5668dc7 100644 --- a/fs/overlayfs/copy_up.c +++ b/fs/overlayfs/copy_up.c @@ -54,7 +54,7 @@ int ovl_copy_xattr(struct dentry *old, struct dentry *new) for (name = buf; name < (buf + list_size); name += strlen(name) + 1) { size = vfs_getxattr(old, name, value, XATTR_SIZE_MAX); - if (size <= 0) { + if (size < 0) { error = size; goto out_free_value; }