Patch "jfs: array-index-out-of-bounds fix in dtReadFirst" has been added to the 5.10-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

    jfs: array-index-out-of-bounds fix in dtReadFirst

to the 5.10-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:
     jfs-array-index-out-of-bounds-fix-in-dtreadfirst.patch
and it can be found in the queue-5.10 subdirectory.

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



commit fc27a83c3a533e30305c0e40b69e5ad830b6173f
Author: Ghanshyam Agrawal <ghanshyam1898@xxxxxxxxx>
Date:   Sat Sep 28 14:07:22 2024 +0530

    jfs: array-index-out-of-bounds fix in dtReadFirst
    
    [ Upstream commit ca84a2c9be482836b86d780244f0357e5a778c46 ]
    
    The value of stbl can be sometimes out of bounds due
    to a bad filesystem. Added a check with appopriate return
    of error code in that case.
    
    Reported-by: syzbot+65fa06e29859e41a83f3@xxxxxxxxxxxxxxxxxxxxxxxxx
    Closes: https://syzkaller.appspot.com/bug?extid=65fa06e29859e41a83f3
    Signed-off-by: Ghanshyam Agrawal <ghanshyam1898@xxxxxxxxx>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/jfs/jfs_dtree.c b/fs/jfs/jfs_dtree.c
index a222a9d71887f..8f7ce1bea44c5 100644
--- a/fs/jfs/jfs_dtree.c
+++ b/fs/jfs/jfs_dtree.c
@@ -3382,6 +3382,13 @@ static int dtReadFirst(struct inode *ip, struct btstack * btstack)
 
 		/* get the leftmost entry */
 		stbl = DT_GETSTBL(p);
+
+		if (stbl[0] < 0 || stbl[0] > 127) {
+			DT_PUTPAGE(mp);
+			jfs_error(ip->i_sb, "stbl[0] out of bound\n");
+			return -EIO;
+		}
+
 		xd = (pxd_t *) & p->slot[stbl[0]];
 
 		/* get the child page block address */




[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