Patch "squashfs: harden sanity check in squashfs_read_xattr_id_table" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    squashfs: harden sanity check in squashfs_read_xattr_id_table

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     squashfs-harden-sanity-check-in-squashfs_read_xattr_.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit e8eae9b33527046b0c42da3b8118de8cc03b89ca
Author: Fedor Pchelkin <pchelkin@xxxxxxxxx>
Date:   Tue Jan 17 13:52:26 2023 +0300

    squashfs: harden sanity check in squashfs_read_xattr_id_table
    
    [ Upstream commit 72e544b1b28325fe78a4687b980871a7e4101f76 ]
    
    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@xxxxxxxxx
    Fixes: 506220d2ba21 ("squashfs: add more sanity checks in xattr id lookup")
    Reported-by: <syzbot+082fa4af80a5bb1a9843@xxxxxxxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Fedor Pchelkin <pchelkin@xxxxxxxxx>
    Signed-off-by: Alexey Khoroshilov <khoroshilov@xxxxxxxxx>
    Cc: Phillip Lougher <phillip@xxxxxxxxxxxxxxx>
    Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/squashfs/xattr_id.c b/fs/squashfs/xattr_id.c
index 087cab8c78f4..f6d78cbc3e74 100644
--- a/fs/squashfs/xattr_id.c
+++ b/fs/squashfs/xattr_id.c
@@ -76,7 +76,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);



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux