aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/array.c
diff options
context:
space:
mode:
authorLukas Czerner <[email protected]>2012-03-22 01:22:22 +0000
committerTheodore Ts'o <[email protected]>2012-03-22 01:22:22 +0000
commit913eed83eda42012cde8a9a801c31b312545c098 (patch)
treec6d3ecf5f98fcb1da3854059dbcc51c27b078011 /fs/proc/array.c
parentext4: update s_free_{inodes,blocks}_count during online resize (diff)
downloadkernel-913eed83eda42012cde8a9a801c31b312545c098.tar.gz
kernel-913eed83eda42012cde8a9a801c31b312545c098.zip
ext4: fix start and len arguments handling in ext4_trim_fs()
The overflow can happen when we are calling get_group_no_and_offset() which stores the group number in the ext4_grpblk_t type which is actually int. However when the blocknr is big enough the group number might be bigger than ext4_grpblk_t resulting in overflow. This will most likely happen with FITRIM default argument len = ULLONG_MAX. Fix this by using "end" variable instead of "start+len" as it is easier to get right and specifically check that the end is not beyond the end of the file system, so we are sure that the result of get_group_no_and_offset() will not overflow. Otherwise truncate it to the size of the file system. Signed-off-by: Lukas Czerner <[email protected]> Reviewed-by: Jan Kara <[email protected]> Signed-off-by: "Theodore Ts'o" <[email protected]>
Diffstat (limited to 'fs/proc/array.c')
0 files changed, 0 insertions, 0 deletions