e2fsck: abort if there is a corrupted directory block when rehashing 69/294669/1 accepted/tizen_6.0_base accepted/tizen_6.0_base_tool tizen_6.0_base accepted/tizen/6.0/base/20230713.142821 accepted/tizen/6.0/base/tool/20230710.095805 submit/tizen_6.0_base/20230705.092351
authorTheodore Ts'o <tytso@mit.edu>
Fri, 20 Dec 2019 00:37:34 +0000 (19:37 -0500)
committerKrystian Czapiga <k.czapiga@samsung.com>
Thu, 22 Jun 2023 14:38:28 +0000 (16:38 +0200)
commit53d302a0fed349220e890ff0415bca8987bd591d
treef69a3552ed333197b67f518e9bfefd44a02786c4
parent8ae457026a5be246281b6866cd14c0909c5773fe
e2fsck: abort if there is a corrupted directory block when rehashing

In e2fsck pass 3a, when we are rehashing directories, at least in
theory, all of the directories should have had corruptions with
respect to directory entry structure fixed.  However, it's possible
(for example, if the user declined a fix) that we can reach this stage
of processing with a corrupted directory entries.

So check for that case and don't try to process a corrupted directory
block so we don't run into trouble in mutate_name() if there is a
zero-length file name.

Change-Id: I41bc9752d8c0dc72956e39a45d8380b5d9375161
Addresses: TALOS-2019-0973
Addresses: CVE-2019-5188
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Origin: upstream, https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/commit/?id=8dd73c149f418238f19791f9d666089ef9734dff
Signed-off-by: Krystian Czapiga <k.czapiga@samsung.com>
e2fsck/rehash.c