On Sat, Oct 28, 2023 at 02:47:47PM +0800, Baokun Li wrote:
commit 43bbddc067883d94de7a43d5756a295439fbe37d upstream.
Why just 5.15 and older? What about 6.1.y? We can't take patches only for older stable kernels, otherwise you will have a regression when you upgrade. Please send a series for 6.1.y if you wish to have us apply these for older kernels.
When we use lstart + len to calculate the end of free extent or prealloc space, it may exceed the maximum value of 4294967295(0xffffffff) supported by ext4_lblk_t and cause overflow, which may lead to various problems.
Therefore, we add two helper functions, extent_logical_end() and pa_logical_end(), to limit the type of end to loff_t, and also convert lstart to loff_t for calculation to avoid overflow.
Signed-off-by: Baokun Li libaokun1@huawei.com Reviewed-by: Ritesh Harjani (IBM) ritesh.list@gmail.com Link: https://lore.kernel.org/r/20230724121059.11834-2-libaokun1@huawei.com Signed-off-by: Theodore Ts'o tytso@mit.edu
Conflicts: fs/ext4/mballoc.c
Note, the "Conflicts:" stuff isn't needed.
thanks,
greg k-h