]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: set type of ac_groups_linear_remaining to __u32 to avoid overflow
authorBaokun Li <libaokun1@huawei.com>
Tue, 19 Mar 2024 11:33:23 +0000 (19:33 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:41:40 +0000 (13:41 +0200)
commit16a392f66a5ae5290b7acf952f28a7565a7d12f2
treea90236b42c7a0b79f01300206b50b0aafcdeed77
parentd47445b041b0b6c84ec14994bc04b7e4c49527c0
ext4: set type of ac_groups_linear_remaining to __u32 to avoid overflow

commit 9a9f3a9842927e4af7ca10c19c94dad83bebd713 upstream.

Now ac_groups_linear_remaining is of type __u16 and s_mb_max_linear_groups
is of type unsigned int, so an overflow occurs when setting a value above
65535 through the mb_max_linear_groups sysfs interface. Therefore, the
type of ac_groups_linear_remaining is set to __u32 to avoid overflow.

Fixes: 196e402adf2e ("ext4: improve cr 0 / cr 1 group scanning")
CC: stable@kernel.org
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20240319113325.3110393-8-libaokun1@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/mballoc.h