Patch "jfs: add a check to prevent array-index-out-of-bounds in dbAdjTree" 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: add a check to prevent array-index-out-of-bounds in dbAdjTree

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-add-a-check-to-prevent-array-index-out-of-bounds.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 b8479184bb4e818e4b6bf892da6525d19495c5cb
Author: Nihar Chaithanya <niharchaithanya@xxxxxxxxx>
Date:   Wed Oct 9 01:51:38 2024 +0530

    jfs: add a check to prevent array-index-out-of-bounds in dbAdjTree
    
    [ Upstream commit a174706ba4dad895c40b1d2277bade16dfacdcd9 ]
    
    When the value of lp is 0 at the beginning of the for loop, it will
    become negative in the next assignment and we should bail out.
    
    Reported-by: syzbot+412dea214d8baa3f7483@xxxxxxxxxxxxxxxxxxxxxxxxx
    Closes: https://syzkaller.appspot.com/bug?extid=412dea214d8baa3f7483
    Tested-by: syzbot+412dea214d8baa3f7483@xxxxxxxxxxxxxxxxxxxxxxxxx
    Signed-off-by: Nihar Chaithanya <niharchaithanya@xxxxxxxxx>
    Signed-off-by: Dave Kleikamp <dave.kleikamp@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index c61fcf0e88d29..ef220709c7f51 100644
--- a/fs/jfs/jfs_dmap.c
+++ b/fs/jfs/jfs_dmap.c
@@ -2953,6 +2953,9 @@ static void dbAdjTree(dmtree_t *tp, int leafno, int newval, bool is_ctl)
 	/* bubble the new value up the tree as required.
 	 */
 	for (k = 0; k < le32_to_cpu(tp->dmt_height); k++) {
+		if (lp == 0)
+			break;
+
 		/* get the index of the first leaf of the 4 leaf
 		 * group containing the specified leaf (leafno).
 		 */




[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