Patch "ext4: set the type of max_zeroout to unsigned int to avoid overflow" has been added to the 5.4-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

    ext4: set the type of max_zeroout to unsigned int to avoid overflow

to the 5.4-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:
     ext4-set-the-type-of-max_zeroout-to-unsigned-int-to-.patch
and it can be found in the queue-5.4 subdirectory.

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



commit 3ac5e6a2c67427d55bd6b02aa3dda281851f2f34
Author: Baokun Li <libaokun1@xxxxxxxxxx>
Date:   Tue Mar 19 19:33:24 2024 +0800

    ext4: set the type of max_zeroout to unsigned int to avoid overflow
    
    [ Upstream commit 261341a932d9244cbcd372a3659428c8723e5a49 ]
    
    The max_zeroout is of type int and the s_extent_max_zeroout_kb is of
    type uint, and the s_extent_max_zeroout_kb can be freely modified via
    the sysfs interface. When the block size is 1024, max_zeroout may
    overflow, so declare it as unsigned int to avoid overflow.
    
    Signed-off-by: Baokun Li <libaokun1@xxxxxxxxxx>
    Reviewed-by: Jan Kara <jack@xxxxxxx>
    Link: https://lore.kernel.org/r/20240319113325.3110393-9-libaokun1@xxxxxxxxxx
    Signed-off-by: Theodore Ts'o <tytso@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index 90b12c7c0f20a..fed3dfed2c249 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -3591,9 +3591,10 @@ static int ext4_ext_convert_to_initialized(handle_t *handle,
 	struct ext4_extent *ex, *abut_ex;
 	ext4_lblk_t ee_block, eof_block;
 	unsigned int ee_len, depth, map_len = map->m_len;
-	int allocated = 0, max_zeroout = 0;
 	int err = 0;
 	int split_flag = EXT4_EXT_DATA_VALID2;
+	int allocated = 0;
+	unsigned int max_zeroout = 0;
 
 	ext_debug("ext4_ext_convert_to_initialized: inode %lu, logical"
 		"block %llu, max_blocks %u\n", inode->i_ino,




[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