]> git.hungrycats.org Git - linux/commit
ext2: Use kvmalloc() for group descriptor array
authorJan Kara <jack@suse.cz>
Wed, 14 Sep 2022 15:29:33 +0000 (17:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 24 Oct 2022 07:58:28 +0000 (09:58 +0200)
commit18c37236b0b0369153ee8a976ed1baf8dc8bd7f8
tree87b1e9e31a8adccaf141b46412c29c8987d978d9
parent2ad8143884b9a14aeb7f951d3e1ba56f0be6c6d2
ext2: Use kvmalloc() for group descriptor array

[ Upstream commit e7c7fbb9a8574ebd89cc05db49d806c7476863ad ]

Array of group descriptor block buffers can get rather large. In theory
in can reach 1MB for perfectly valid filesystem and even more for
maliciously crafted ones. Use kvmalloc() to allocate the array to avoid
straining memory allocator with large order allocations unnecessarily.

Reported-by: syzbot+0f2f7e65a3007d39539f@syzkaller.appspotmail.com
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ext2/super.c