Skip to content

Commit 4690176

Browse files
insuyuntytso
authored andcommitted
ext4: fix potential integer overflow
Since sizeof(ext_new_group_data) > sizeof(ext_new_flex_group_data), integer overflow could be happened. Therefore, need to fix integer overflow sanitization. Cc: stable@vger.kernel.org Signed-off-by: Insu Yun <wuninsu@gmail.com> Signed-off-by: Theodore Ts'o <tytso@mit.edu>
1 parent 802cf1f commit 4690176

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/ext4/resize.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ static struct ext4_new_flex_group_data *alloc_flex_gd(unsigned long flexbg_size)
198198
if (flex_gd == NULL)
199199
goto out3;
200200

201-
if (flexbg_size >= UINT_MAX / sizeof(struct ext4_new_flex_group_data))
201+
if (flexbg_size >= UINT_MAX / sizeof(struct ext4_new_group_data))
202202
goto out2;
203203
flex_gd->count = flexbg_size;
204204

0 commit comments

Comments
 (0)