Skip to content

Commit c9a70ca

Browse files
Lizhi Xuopsiff
authored andcommitted
ext4: filesystems without casefold feature cannot be mounted with siphash
commit 985b67c upstream. When mounting the ext4 filesystem, if the default hash version is set to DX_HASH_SIPHASH but the casefold feature is not set, exit the mounting. Reported-by: syzbot+340581ba9dceb7e06fb3@syzkaller.appspotmail.com Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com> Link: https://patch.msgid.link/20240605012335.44086-1-lizhi.xu@windriver.com Signed-off-by: Theodore Ts'o <tytso@mit.edu> [cascardo: small conflict fixup] Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@igalia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 52c4538a92da6f3242d4140c03ddc5ee71b39ba8) Signed-off-by: Wentao Guan <guanwentao@uniontech.com>
1 parent 12cbed9 commit c9a70ca

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

fs/ext4/super.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3639,6 +3639,14 @@ int ext4_feature_set_ok(struct super_block *sb, int readonly)
36393639
}
36403640
#endif
36413641

3642+
if (EXT4_SB(sb)->s_es->s_def_hash_version == DX_HASH_SIPHASH &&
3643+
!ext4_has_feature_casefold(sb)) {
3644+
ext4_msg(sb, KERN_ERR,
3645+
"Filesystem without casefold feature cannot be "
3646+
"mounted with siphash");
3647+
return 0;
3648+
}
3649+
36423650
if (readonly)
36433651
return 1;
36443652

0 commit comments

Comments
 (0)