mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-10-24 19:10:26 +00:00
ext4: validate s_reserved_gdt_blocks on mount
[ Upstream commit e1d8c1feecf672379c50ab045fd94548468bc987 ]
[ Upstream commit 5b9554dc5b ]
If s_reserved_gdt_blocks is extremely large, it's possible for
ext4_init_block_bitmap(), which is called when ext4 sets up an
uninitialized block bitmap, to corrupt random kernel memory. Add the
same checks which e2fsck has --- it must never be larger than
blocksize / sizeof(__u32) --- and then add a backup check in
ext4_init_block_bitmap() in case the superblock gets modified after
the file system is mounted.
Reported-by: Vegard Nossum <vegard.nossum@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
This commit is contained in:
parent
926d244dfa
commit
5467159ce7
2 changed files with 10 additions and 0 deletions
Loading…
Add table
Add a link
Reference in a new issue