OSDN Git Service

ext4: fix kernel oops caused by spurious casefold flag
authorTheodore Ts'o <tytso@mit.edu>
Tue, 3 Sep 2019 05:43:17 +0000 (01:43 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 3 Sep 2019 05:43:17 +0000 (01:43 -0400)
commit6456ca6520ab6c9aec589b4640169cd6da378c68
treefd571eddedc34f63bc84e72e6c6c190ec0056be0
parent9ba55543fc0c6bb1cf8edd63be8802d9ab7e1202
ext4: fix kernel oops caused by spurious casefold flag

If an directory has the a casefold flag set without the casefold
feature set, s_encoding will not be initialized, and this will cause
the kernel to dereference a NULL pointer.  In addition to adding
checks to avoid these kernel oops, attempts to load inodes with the
casefold flag when the casefold feature is not enable will cause the
file system to be declared corrupted.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/dir.c
fs/ext4/hash.c
fs/ext4/inode.c
fs/ext4/namei.c