update commit description for fix-memleak-in-ext4_readdir
[ext4-patch-queue.git] / fix-potential-integer-overflow
blobc49696b4aa625ddf53ddaab86169353796adbfb7
1 ext4: fix potential integer overflow
3 From: Insu Yun <wuninsu@gmail.com>
5 Since sizeof(ext_new_group_data) > sizeof(ext_new_flex_group_data),
6 integer overflow could be happened.
7 Therefore, need to fix integer overflow sanitization.
9 Cc: stable@vger.kernel.org
10 Signed-off-by: Insu Yun <wuninsu@gmail.com>
11 Signed-off-by: Theodore Ts'o <tytso@mit.edu>
12 ---
13  fs/ext4/resize.c | 2 +-
14  1 file changed, 1 insertion(+), 1 deletion(-)
16 diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
17 index ad62d7a..34038e3 100644
18 --- a/fs/ext4/resize.c
19 +++ b/fs/ext4/resize.c
20 @@ -198,7 +198,7 @@ static struct ext4_new_flex_group_data *alloc_flex_gd(unsigned long flexbg_size)
21         if (flex_gd == NULL)
22                 goto out3;
24 -       if (flexbg_size >= UINT_MAX / sizeof(struct ext4_new_flex_group_data))
25 +       if (flexbg_size >= UINT_MAX / sizeof(struct ext4_new_group_data))
26                 goto out2;
27         flex_gd->count = flexbg_size;
29 -- 
30 1.9.1