All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: mm-commits@vger.kernel.org,
	syzbot+082fa4af80a5bb1a9843@syzkaller.appspotmail.com,
	phillip@squashfs.org.uk, khoroshilov@ispras.ru,
	pchelkin@ispras.ru, akpm@linux-foundation.org
Subject: [merged mm-hotfixes-stable] squashfs-harden-sanity-check-in-squashfs_read_xattr_id_table.patch removed from -mm tree
Date: Tue, 31 Jan 2023 16:45:02 -0800	[thread overview]
Message-ID: <20230201004502.86FC6C4339B@smtp.kernel.org> (raw)


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



                 reply	other threads:[~2023-02-01  0:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230201004502.86FC6C4339B@smtp.kernel.org \
    --to=akpm@linux-foundation.org \
    --cc=khoroshilov@ispras.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=pchelkin@ispras.ru \
    --cc=phillip@squashfs.org.uk \
    --cc=syzbot+082fa4af80a5bb1a9843@syzkaller.appspotmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.