summaryrefslogtreecommitdiffstats
path: root/fs/squashfs
diff options
context:
space:
mode:
authorAndrew Morton <akpm@linux-foundation.org>2023-02-02 18:07:35 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-02-22 12:47:20 +0100
commit2ab96a0ee1e32757d067f7e8b6b66ca217e02bd8 (patch)
tree27b63941c980136ab0bb6eaed6c5b46d1f7ef4ea /fs/squashfs
parent0158f14945ef63f0c1dd4892822f11aeedba6240 (diff)
downloadlinux-stable-2ab96a0ee1e32757d067f7e8b6b66ca217e02bd8.tar.gz
linux-stable-2ab96a0ee1e32757d067f7e8b6b66ca217e02bd8.tar.bz2
linux-stable-2ab96a0ee1e32757d067f7e8b6b66ca217e02bd8.zip
revert "squashfs: harden sanity check in squashfs_read_xattr_id_table"
commit a5b21d8d791cd4db609d0bbcaa9e0c7e019888d1 upstream. This fix was nacked by Philip, for reasons identified in the email linked below. Link: https://lkml.kernel.org/r/68f15d67-8945-2728-1f17-5b53a80ec52d@squashfs.org.uk Fixes: 72e544b1b28325 ("squashfs: harden sanity check in squashfs_read_xattr_id_table") Cc: Alexey Khoroshilov <khoroshilov@ispras.ru> Cc: Fedor Pchelkin <pchelkin@ispras.ru> Cc: Phillip Lougher <phillip@squashfs.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/squashfs')
-rw-r--r--fs/squashfs/xattr_id.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/squashfs/xattr_id.c b/fs/squashfs/xattr_id.c
index 2ef0e43418fc..fe266b3e95f8 100644
--- a/fs/squashfs/xattr_id.c
+++ b/fs/squashfs/xattr_id.c
@@ -89,7 +89,7 @@ __le64 *squashfs_read_xattr_id_table(struct super_block *sb, u64 table_start,
/* Sanity check values */
/* there is always at least one xattr id */
- if (*xattr_ids <= 0)
+ if (*xattr_ids == 0)
return ERR_PTR(-EINVAL);
len = SQUASHFS_XATTR_BLOCK_BYTES(*xattr_ids);