Skip to content

Commit

Permalink
ovl: allow zero size xattr
Browse files Browse the repository at this point in the history
[ Upstream commit 97daf8b97ad6f913a34c82515be64dc9ac08d63e ]

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 <miklos@szeredi.hu>
Cc: <stable@vger.kernel.org>
Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
  • Loading branch information
szmi authored and Mohi1117 committed Feb 15, 2018
1 parent 390389b commit 7c64d60
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/overlayfs/copy_up.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 7c64d60

Please sign in to comment.