ext4: fix stack memory corruption with 64k block size
authorChandan Rajendra <chandan@linux.vnet.ibm.com>
Tue, 15 Nov 2016 02:26:26 +0000 (21:26 -0500)
committerWilly Tarreau <w@1wt.eu>
Wed, 7 Jun 2017 22:46:49 +0000 (00:46 +0200)
commitac3d8fba0618c9f68832ea9fc6fe6615bda4de8d
tree25be7948e467e9be3114319b0877d5d1bd096456
parentcafd2159d1fd4e43f50229476b2d9a02a6ab47c3
ext4: fix stack memory corruption with 64k block size

commit 30a9d7afe70ed6bd9191d3000e2ef1a34fb58493 upstream.

The number of 'counters' elements needed in 'struct sg' is
super_block->s_blocksize_bits + 2. Presently we have 16 'counters'
elements in the array. This is insufficient for block sizes >= 32k. In
such cases the memcpy operation performed in ext4_mb_seq_groups_show()
would cause stack memory corruption.

Fixes: c9de560ded61f
Signed-off-by: Chandan Rajendra <chandan@linux.vnet.ibm.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Willy Tarreau <w@1wt.eu>
fs/ext4/mballoc.c