]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: avoid cycles in directory h-tree
authorJan Kara <jack@suse.cz>
Wed, 18 May 2022 09:33:29 +0000 (11:33 +0200)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 24 May 2022 19:34:13 +0000 (15:34 -0400)
commit416755a31690ada0a2f775ca1efb000757e31679
treeb23ac2e1ccd5cd223ccc7cd51ae101698624cc2b
parent06da1894098aadad7ea604371163c49e1e87cfb2
ext4: avoid cycles in directory h-tree

A maliciously corrupted filesystem can contain cycles in the h-tree
stored inside a directory. That can easily lead to the kernel corrupting
tree nodes that were already verified under its hands while doing a node
split and consequently accessing unallocated memory. Fix the problem by
verifying traversed block numbers are unique.

Cc: stable@vger.kernel.org
Signed-off-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/20220518093332.13986-2-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/namei.c