All of lore.kernel.org
 help / color / mirror / Atom feed
* [merged mm-hotfixes-stable] squashfs-harden-sanity-check-in-squashfs_read_xattr_id_table.patch removed from -mm tree
@ 2023-02-01  0:45 Andrew Morton
  0 siblings, 0 replies; only message in thread
From: Andrew Morton @ 2023-02-01  0:45 UTC (permalink / raw)
  To: mm-commits, syzbot+082fa4af80a5bb1a9843, phillip, khoroshilov,
	pchelkin, akpm


The quilt patch titled
     Subject: squashfs: harden sanity check in squashfs_read_xattr_id_table
has been removed from the -mm tree.  Its filename was
     squashfs-harden-sanity-check-in-squashfs_read_xattr_id_table.patch

This patch was dropped because it was merged into the mm-hotfixes-stable branch
of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm

------------------------------------------------------
From: Fedor Pchelkin <pchelkin@ispras.ru>
Subject: squashfs: harden sanity check in squashfs_read_xattr_id_table
Date: Tue, 17 Jan 2023 13:52:26 +0300

While mounting a corrupted filesystem, a signed integer '*xattr_ids' can
become less than zero.  This leads to the incorrect computation of 'len'
and 'indexes' values which can cause null-ptr-deref in copy_bio_to_actor()
or out-of-bounds accesses in the next sanity checks inside
squashfs_read_xattr_id_table().

Found by Linux Verification Center (linuxtesting.org) with Syzkaller.

Link: https://lkml.kernel.org/r/20230117105226.329303-2-pchelkin@ispras.ru
Fixes: 506220d2ba21 ("squashfs: add more sanity checks in xattr id lookup")
Reported-by: <syzbot+082fa4af80a5bb1a9843@syzkaller.appspotmail.com>
Signed-off-by: Fedor Pchelkin <pchelkin@ispras.ru>
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Cc: Phillip Lougher <phillip@squashfs.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 fs/squashfs/xattr_id.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/fs/squashfs/xattr_id.c~squashfs-harden-sanity-check-in-squashfs_read_xattr_id_table
+++ a/fs/squashfs/xattr_id.c
@@ -76,7 +76,7 @@ __le64 *squashfs_read_xattr_id_table(str
 	/* 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);
_

Patches currently in -mm which might be from pchelkin@ispras.ru are



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-01  0:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-01  0:45 [merged mm-hotfixes-stable] squashfs-harden-sanity-check-in-squashfs_read_xattr_id_table.patch removed from -mm tree Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.