Patch "udf: fix uninit-value use in udf_get_fileshortad" 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

    udf: fix uninit-value use in udf_get_fileshortad

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:
     udf-fix-uninit-value-use-in-udf_get_fileshortad.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 f2eccfb3f6c6aaeb2ea75bc46d998cd75d1429cb
Author: Gianfranco Trad <gianf.trad@xxxxxxxxx>
Date:   Wed Sep 25 09:46:15 2024 +0200

    udf: fix uninit-value use in udf_get_fileshortad
    
    [ Upstream commit 264db9d666ad9a35075cc9ed9ec09d021580fbb1 ]
    
    Check for overflow when computing alen in udf_current_aext to mitigate
    later uninit-value use in udf_get_fileshortad KMSAN bug[1].
    After applying the patch reproducer did not trigger any issue[2].
    
    [1] https://syzkaller.appspot.com/bug?extid=8901c4560b7ab5c2f9df
    [2] https://syzkaller.appspot.com/x/log.txt?x=10242227980000
    
    Reported-by: syzbot+8901c4560b7ab5c2f9df@xxxxxxxxxxxxxxxxxxxxxxxxx
    Closes: https://syzkaller.appspot.com/bug?extid=8901c4560b7ab5c2f9df
    Tested-by: syzbot+8901c4560b7ab5c2f9df@xxxxxxxxxxxxxxxxxxxxxxxxx
    Suggested-by: Jan Kara <jack@xxxxxxxx>
    Signed-off-by: Gianfranco Trad <gianf.trad@xxxxxxxxx>
    Signed-off-by: Jan Kara <jack@xxxxxxx>
    Link: https://patch.msgid.link/20240925074613.8475-3-gianf.trad@xxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/udf/inode.c b/fs/udf/inode.c
index 443d747bcec2e..81bd01ea89eb6 100644
--- a/fs/udf/inode.c
+++ b/fs/udf/inode.c
@@ -2112,12 +2112,15 @@ int udf_current_aext(struct inode *inode, struct extent_position *epos,
 		alen = udf_file_entry_alloc_offset(inode) +
 							iinfo->i_lenAlloc;
 	} else {
+		struct allocExtDesc *header =
+			(struct allocExtDesc *)epos->bh->b_data;
+
 		if (!epos->offset)
 			epos->offset = sizeof(struct allocExtDesc);
 		ptr = epos->bh->b_data + epos->offset;
-		alen = sizeof(struct allocExtDesc) +
-			le32_to_cpu(((struct allocExtDesc *)epos->bh->b_data)->
-							lengthAllocDescs);
+		if (check_add_overflow(sizeof(struct allocExtDesc),
+				le32_to_cpu(header->lengthAllocDescs), &alen))
+			return -1;
 	}
 
 	switch (iinfo->i_alloc_type) {




[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