Skip to content

Commit

Permalink
ext4: fix potential integer overflow
Browse files Browse the repository at this point in the history
commit 46901760b46064964b41015d00c140c83aa05bcf upstream.

Since sizeof(ext_new_group_data) > sizeof(ext_new_flex_group_data),
integer overflow could be happened.
Therefore, need to fix integer overflow sanitization.

Signed-off-by: Insu Yun <[email protected]>
Signed-off-by: Theodore Ts'o <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
insuyun authored and gregkh committed Feb 25, 2016
1 parent ff19ac8 commit 819f428
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion fs/ext4/resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ static struct ext4_new_flex_group_data *alloc_flex_gd(unsigned long flexbg_size)
if (flex_gd == NULL)
goto out3;

if (flexbg_size >= UINT_MAX / sizeof(struct ext4_new_flex_group_data))
if (flexbg_size >= UINT_MAX / sizeof(struct ext4_new_group_data))
goto out2;
flex_gd->count = flexbg_size;

Expand Down

0 comments on commit 819f428

Please sign in to comment.