diff options
author | Kemeng Shi <[email protected]> | 2023-08-01 22:31:56 +0800 |
---|---|---|
committer | Theodore Ts'o <[email protected]> | 2023-08-03 10:47:29 -0400 |
commit | 60c672b7f2d1e5dd1774f2399b355c9314e709f8 (patch) | |
tree | ed46ae5c8c6ebba0512bbc1494ecc57dd382e10d /net/lapb/lapb_subr.c | |
parent | a9ce5993a0f5c0887c8a1b4ffa3b8046fbcfdc93 (diff) |
ext4: avoid potential data overflow in next_linear_group
ngroups is ext4_group_t (unsigned int) while next_linear_group treat it
in int. If ngroups is bigger than max number described by int, it will
be treat as a negative number. Then "return group + 1 >= ngroups ? 0 :
group + 1;" may keep returning 0.
Switch int to ext4_group_t in next_linear_group to fix the overflow.
Fixes: 196e402adf2e ("ext4: improve cr 0 / cr 1 group scanning")
Signed-off-by: Kemeng Shi <[email protected]>
Reviewed-by: Ritesh Harjani (IBM) <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
Diffstat (limited to 'net/lapb/lapb_subr.c')
0 files changed, 0 insertions, 0 deletions