]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
ovl: allow zero size xattr
authorMiklos Szeredi <miklos@szeredi.hu>
Tue, 10 Nov 2015 16:08:41 +0000 (17:08 +0100)
committerSomasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Tue, 1 Aug 2017 15:52:19 +0000 (08:52 -0700)
Orabug: 2654637926540706
CVE-2016-1575
CVE-2016-1576

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>
(cherry picked from commit 97daf8b97ad6f913a34c82515be64dc9ac08d63e)
Signed-off-by: Somasundaram Krishnasamy <somasundaram.krishnasamy@oracle.com>
Reviewed-by: Jack Vogel <jack.vogel@oracle.com>
fs/overlayfs/copy_up.c

index 2927d18ff43653f4675dc45a13dd24765efada60..247bce0ad4a95bc8fa530a5f3d8bc1cc0971d186 100644 (file)
@@ -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;
                }