From: Haogang Chen Date: Mon, 28 May 2012 18:21:55 +0000 (-0400) Subject: ext4: fix potential integer overflow in alloc_flex_gd() X-Git-Tag: v3.5-rc1~16^2~15 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=967ac8af4475ce45474800709b12137aa7634c77;p=pandora-kernel.git ext4: fix potential integer overflow in alloc_flex_gd() In alloc_flex_gd(), when flexbg_size is large, kmalloc size would overflow and flex_gd->groups would point to a buffer smaller than expected, causing OOB accesses when it is used. Note that in ext4_resize_fs(), flexbg_size is calculated using sbi->s_log_groups_per_flex, which is read from the disk and only bounded to [1, 31]. The patch returns NULL for too large flexbg_size. Reviewed-by: Eric Sandeen Signed-off-by: Haogang Chen Signed-off-by: "Theodore Ts'o" Cc: stable@kernel.org --- Reading git-diff-tree failed