* [PATCH 6.1.y 0/3] ext4: Fix warning related to siphash and ext4 filesystem mounting
@ 2024-11-18 10:20 Vasiliy Kovalev
2024-11-18 10:20 ` [PATCH 1/3] ext4: factor out ext4_hash_info_init() Vasiliy Kovalev
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Vasiliy Kovalev @ 2024-11-18 10:20 UTC (permalink / raw)
To: Greg Kroah-Hartman, Sasha Levin, stable
Cc: lvc-project, dutyrok, gerben, kovalev
Found by syzbot (https://syzkaller.appspot.com/bug?extid=9177d065333561cd6fd0):
EXT4-fs (loop0): encrypted files will use data=ordered instead of data journaling mode
EXT4-fs (loop0): 1 truncate cleaned up
EXT4-fs (loop0): mounted filesystem without journal. Quota mode: none.
fscrypt: AES-256-CTS-CBC using implementation "cts-cbc-aes-aesni"
------------[ cut here ]------------
WARNING: CPU: 1 PID: 4245 at fs/crypto/fname.c:567 fscrypt_fname_siphash+0xb9/0xf0
Modules linked in:
CPU: 1 PID: 4245 Comm: syz-executor375 Not tainted 6.1.116-syzkaller #0
Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 09/13/2024
RIP: 0010:fscrypt_fname_siphash+0xb9/0xf0 fs/crypto/fname.c:567
Call Trace:
<TASK>
__ext4fs_dirhash+0xdd2/0x14c0 fs/ext4/hash.c:268
ext4fs_dirhash+0x1b8/0x320 fs/ext4/hash.c:322
htree_dirblock_to_tree+0x723/0x10d0 fs/ext4/namei.c:1125
ext4_htree_fill_tree+0x73d/0x13f0 fs/ext4/namei.c:1220
ext4_dx_readdir fs/ext4/dir.c:605 [inline]
ext4_readdir+0x2e87/0x3880 fs/ext4/dir.c:142
iterate_dir+0x224/0x560
__do_sys_getdents64 fs/readdir.c:369 [inline]
__se_sys_getdents64+0x209/0x4f0 fs/readdir.c:354
do_syscall_x64 arch/x86/entry/common.c:51 [inline]
do_syscall_64+0x3b/0xb0 arch/x86/entry/common.c:81
</TASK>
These patches address a warning encountered when mounting ext4 filesystems
with the default hash version set to SIPHASH while the casefold feature is not
enabled. The warning occurs due to incorrect error handling and setup of the
default hash version.
[PATCH 1/3 ] ext4: factor out ext4_hash_info_init()
Simplifies the ext4 filesystem setup by factoring out the ext4_hash_info_init
function, with no functional change.
[PATCH 2/3] ext4: filesystems without casefold feature cannot be mounted with siphash
Ensures that ext4 filesystems with the default hash set to SIPHASH cannot be
mounted if the casefold feature is not enabled.
[PATCH 3/3] ext4: fix error message when rejecting the default hash
Corrects the error message logic for rejecting filesystems with the default
SIPHASH hash version, ensuring the error message doesn't incorrectly
reference the casefold setup. Also moves the check to ext4_hash_info_init
to ensure consistency.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH 1/3] ext4: factor out ext4_hash_info_init()
2024-11-18 10:20 [PATCH 6.1.y 0/3] ext4: Fix warning related to siphash and ext4 filesystem mounting Vasiliy Kovalev
@ 2024-11-18 10:20 ` Vasiliy Kovalev
2024-11-19 4:36 ` Sasha Levin
2024-11-18 10:20 ` [PATCH 2/3] ext4: filesystems without casefold feature cannot be mounted with siphash Vasiliy Kovalev
2024-11-18 10:20 ` [PATCH 3/3] ext4: fix error message when rejecting the default hash Vasiliy Kovalev
2 siblings, 1 reply; 7+ messages in thread
From: Vasiliy Kovalev @ 2024-11-18 10:20 UTC (permalink / raw)
To: Greg Kroah-Hartman, Sasha Levin, stable
Cc: lvc-project, dutyrok, gerben, kovalev
From: Jason Yan <yanaijie@huawei.com>
[ Upstream commit db9345d9e6f075e1ec26afadf744078ead935fec ]
Factor out ext4_hash_info_init() to simplify __ext4_fill_super(). No
functional change.
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Link: https://lore.kernel.org/r/20230323140517.1070239-2-yanaijie@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
---
fs/ext4/super.c | 50 +++++++++++++++++++++++++++++--------------------
1 file changed, 30 insertions(+), 20 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 3bf214d4afef5..cf2c8cf507780 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -5042,6 +5042,35 @@ static int ext4_load_super(struct super_block *sb, ext4_fsblk_t *lsb,
return ret;
}
+static void ext4_hash_info_init(struct super_block *sb)
+{
+ struct ext4_sb_info *sbi = EXT4_SB(sb);
+ struct ext4_super_block *es = sbi->s_es;
+ unsigned int i;
+
+ for (i = 0; i < 4; i++)
+ sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]);
+
+ sbi->s_def_hash_version = es->s_def_hash_version;
+ if (ext4_has_feature_dir_index(sb)) {
+ i = le32_to_cpu(es->s_flags);
+ if (i & EXT2_FLAGS_UNSIGNED_HASH)
+ sbi->s_hash_unsigned = 3;
+ else if ((i & EXT2_FLAGS_SIGNED_HASH) == 0) {
+#ifdef __CHAR_UNSIGNED__
+ if (!sb_rdonly(sb))
+ es->s_flags |=
+ cpu_to_le32(EXT2_FLAGS_UNSIGNED_HASH);
+ sbi->s_hash_unsigned = 3;
+#else
+ if (!sb_rdonly(sb))
+ es->s_flags |=
+ cpu_to_le32(EXT2_FLAGS_SIGNED_HASH);
+#endif
+ }
+ }
+}
+
static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
{
struct ext4_super_block *es = NULL;
@@ -5197,26 +5226,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
sbi->s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb));
sbi->s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb));
- for (i = 0; i < 4; i++)
- sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]);
- sbi->s_def_hash_version = es->s_def_hash_version;
- if (ext4_has_feature_dir_index(sb)) {
- i = le32_to_cpu(es->s_flags);
- if (i & EXT2_FLAGS_UNSIGNED_HASH)
- sbi->s_hash_unsigned = 3;
- else if ((i & EXT2_FLAGS_SIGNED_HASH) == 0) {
-#ifdef __CHAR_UNSIGNED__
- if (!sb_rdonly(sb))
- es->s_flags |=
- cpu_to_le32(EXT2_FLAGS_UNSIGNED_HASH);
- sbi->s_hash_unsigned = 3;
-#else
- if (!sb_rdonly(sb))
- es->s_flags |=
- cpu_to_le32(EXT2_FLAGS_SIGNED_HASH);
-#endif
- }
- }
+ ext4_hash_info_init(sb);
if (ext4_handle_clustersize(sb))
goto failed_mount;
--
2.33.8
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 2/3] ext4: filesystems without casefold feature cannot be mounted with siphash
2024-11-18 10:20 [PATCH 6.1.y 0/3] ext4: Fix warning related to siphash and ext4 filesystem mounting Vasiliy Kovalev
2024-11-18 10:20 ` [PATCH 1/3] ext4: factor out ext4_hash_info_init() Vasiliy Kovalev
@ 2024-11-18 10:20 ` Vasiliy Kovalev
2024-11-19 4:36 ` Sasha Levin
2024-11-18 10:20 ` [PATCH 3/3] ext4: fix error message when rejecting the default hash Vasiliy Kovalev
2 siblings, 1 reply; 7+ messages in thread
From: Vasiliy Kovalev @ 2024-11-18 10:20 UTC (permalink / raw)
To: Greg Kroah-Hartman, Sasha Levin, stable
Cc: lvc-project, dutyrok, gerben, kovalev
From: Lizhi Xu <lizhi.xu@windriver.com>
[ Upstream commit 985b67cd86392310d9e9326de941c22fc9340eec ]
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>
Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
---
fs/ext4/super.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index cf2c8cf507780..68070b1859803 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3559,6 +3559,14 @@ int ext4_feature_set_ok(struct super_block *sb, int readonly)
}
#endif
+ if (EXT4_SB(sb)->s_es->s_def_hash_version == DX_HASH_SIPHASH &&
+ !ext4_has_feature_casefold(sb)) {
+ ext4_msg(sb, KERN_ERR,
+ "Filesystem without casefold feature cannot be "
+ "mounted with siphash");
+ return 0;
+ }
+
if (readonly)
return 1;
--
2.33.8
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH 3/3] ext4: fix error message when rejecting the default hash
2024-11-18 10:20 [PATCH 6.1.y 0/3] ext4: Fix warning related to siphash and ext4 filesystem mounting Vasiliy Kovalev
2024-11-18 10:20 ` [PATCH 1/3] ext4: factor out ext4_hash_info_init() Vasiliy Kovalev
2024-11-18 10:20 ` [PATCH 2/3] ext4: filesystems without casefold feature cannot be mounted with siphash Vasiliy Kovalev
@ 2024-11-18 10:20 ` Vasiliy Kovalev
2024-11-19 4:36 ` Sasha Levin
2 siblings, 1 reply; 7+ messages in thread
From: Vasiliy Kovalev @ 2024-11-18 10:20 UTC (permalink / raw)
To: Greg Kroah-Hartman, Sasha Levin, stable
Cc: lvc-project, dutyrok, gerben, kovalev
From: Gabriel Krisman Bertazi <krisman@suse.de>
[ Upstream commit a2187431c395cdfbf144e3536f25468c64fc7cfa ]
Commit 985b67cd8639 ("ext4: filesystems without casefold feature cannot
be mounted with siphash") properly rejects volumes where
s_def_hash_version is set to DX_HASH_SIPHASH, but the check and the
error message should not look into casefold setup - a filesystem should
never have DX_HASH_SIPHASH as the default hash. Fix it and, since we
are there, move the check to ext4_hash_info_init.
Fixes:985b67cd8639 ("ext4: filesystems without casefold feature cannot
be mounted with siphash")
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
Link: https://patch.msgid.link/87jzg1en6j.fsf_-_@mailhost.krisman.be
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
---
fs/ext4/ext4.h | 1 +
fs/ext4/super.c | 28 +++++++++++++++++-----------
2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
index 72abb8d6caf75..d5706aedf4fef 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
@@ -2449,6 +2449,7 @@ static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize)
#define DX_HASH_HALF_MD4_UNSIGNED 4
#define DX_HASH_TEA_UNSIGNED 5
#define DX_HASH_SIPHASH 6
+#define DX_HASH_LAST DX_HASH_SIPHASH
static inline u32 ext4_chksum(struct ext4_sb_info *sbi, u32 crc,
const void *address, unsigned int length)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 68070b1859803..3e4b9bf101454 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -3559,14 +3559,6 @@ int ext4_feature_set_ok(struct super_block *sb, int readonly)
}
#endif
- if (EXT4_SB(sb)->s_es->s_def_hash_version == DX_HASH_SIPHASH &&
- !ext4_has_feature_casefold(sb)) {
- ext4_msg(sb, KERN_ERR,
- "Filesystem without casefold feature cannot be "
- "mounted with siphash");
- return 0;
- }
-
if (readonly)
return 1;
@@ -5050,16 +5042,27 @@ static int ext4_load_super(struct super_block *sb, ext4_fsblk_t *lsb,
return ret;
}
-static void ext4_hash_info_init(struct super_block *sb)
+static int ext4_hash_info_init(struct super_block *sb)
{
struct ext4_sb_info *sbi = EXT4_SB(sb);
struct ext4_super_block *es = sbi->s_es;
unsigned int i;
+ sbi->s_def_hash_version = es->s_def_hash_version;
+
+ if (sbi->s_def_hash_version > DX_HASH_LAST) {
+ ext4_msg(sb, KERN_ERR,
+ "Invalid default hash set in the superblock");
+ return -EINVAL;
+ } else if (sbi->s_def_hash_version == DX_HASH_SIPHASH) {
+ ext4_msg(sb, KERN_ERR,
+ "SIPHASH is not a valid default hash value");
+ return -EINVAL;
+ }
+
for (i = 0; i < 4; i++)
sbi->s_hash_seed[i] = le32_to_cpu(es->s_hash_seed[i]);
- sbi->s_def_hash_version = es->s_def_hash_version;
if (ext4_has_feature_dir_index(sb)) {
i = le32_to_cpu(es->s_flags);
if (i & EXT2_FLAGS_UNSIGNED_HASH)
@@ -5077,6 +5080,7 @@ static void ext4_hash_info_init(struct super_block *sb)
#endif
}
}
+ return 0;
}
static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
@@ -5234,7 +5238,9 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
sbi->s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb));
sbi->s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb));
- ext4_hash_info_init(sb);
+ err = ext4_hash_info_init(sb);
+ if (err)
+ goto failed_mount;
if (ext4_handle_clustersize(sb))
goto failed_mount;
--
2.33.8
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH 1/3] ext4: factor out ext4_hash_info_init()
2024-11-18 10:20 ` [PATCH 1/3] ext4: factor out ext4_hash_info_init() Vasiliy Kovalev
@ 2024-11-19 4:36 ` Sasha Levin
0 siblings, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2024-11-19 4:36 UTC (permalink / raw)
To: stable; +Cc: Vasiliy Kovalev, Sasha Levin
[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: db9345d9e6f075e1ec26afadf744078ead935fec
WARNING: Author mismatch between patch and upstream commit:
Backport author: Vasiliy Kovalev <kovalev@altlinux.org>
Commit author: Jason Yan <yanaijie@huawei.com>
Commit in newer trees:
|-----------------|----------------------------------------------|
| 6.11.y | Present (exact SHA1) |
|-----------------|----------------------------------------------|
Note: The patch differs from the upstream commit:
---
--- - 2024-11-18 17:26:48.895059440 -0500
+++ /tmp/tmp.VjhMY5d2bY 2024-11-18 17:26:48.887055706 -0500
@@ -1,18 +1,21 @@
+[ Upstream commit db9345d9e6f075e1ec26afadf744078ead935fec ]
+
Factor out ext4_hash_info_init() to simplify __ext4_fill_super(). No
functional change.
Signed-off-by: Jason Yan <yanaijie@huawei.com>
Link: https://lore.kernel.org/r/20230323140517.1070239-2-yanaijie@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
---
fs/ext4/super.c | 50 +++++++++++++++++++++++++++++--------------------
1 file changed, 30 insertions(+), 20 deletions(-)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
-index 690faf766d23a..13c0345c53873 100644
+index 3bf214d4afef5..cf2c8cf507780 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
-@@ -5024,6 +5024,35 @@ static int ext4_load_super(struct super_block *sb, ext4_fsblk_t *lsb,
+@@ -5042,6 +5042,35 @@ static int ext4_load_super(struct super_block *sb, ext4_fsblk_t *lsb,
return ret;
}
@@ -48,7 +51,7 @@
static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
{
struct ext4_super_block *es = NULL;
-@@ -5179,26 +5208,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
+@@ -5197,26 +5226,7 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
sbi->s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb));
sbi->s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb));
@@ -76,3 +79,6 @@
if (ext4_handle_clustersize(sb))
goto failed_mount;
+--
+2.33.8
+
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.11.y | Failed | N/A |
| stable/linux-6.6.y | Failed | N/A |
| stable/linux-6.1.y | Success | Success |
| stable/linux-5.15.y | Failed | N/A |
| stable/linux-5.10.y | Failed | N/A |
| stable/linux-5.4.y | Failed | N/A |
| stable/linux-4.19.y | Failed | N/A |
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] ext4: filesystems without casefold feature cannot be mounted with siphash
2024-11-18 10:20 ` [PATCH 2/3] ext4: filesystems without casefold feature cannot be mounted with siphash Vasiliy Kovalev
@ 2024-11-19 4:36 ` Sasha Levin
0 siblings, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2024-11-19 4:36 UTC (permalink / raw)
To: stable; +Cc: Vasiliy Kovalev, Sasha Levin
[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: 985b67cd86392310d9e9326de941c22fc9340eec
WARNING: Author mismatch between patch and upstream commit:
Backport author: Vasiliy Kovalev <kovalev@altlinux.org>
Commit author: Lizhi Xu <lizhi.xu@windriver.com>
Commit in newer trees:
|-----------------|----------------------------------------------|
| 6.11.y | Present (different SHA1: e1373903db6c) |
|-----------------|----------------------------------------------|
Note: The patch differs from the upstream commit:
---
--- - 2024-11-18 22:36:26.258041949 -0500
+++ /tmp/tmp.H7dIMzFjni 2024-11-18 22:36:26.250299326 -0500
@@ -1,3 +1,5 @@
+[ Upstream commit 985b67cd86392310d9e9326de941c22fc9340eec ]
+
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.
@@ -5,18 +7,19 @@
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>
+Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
---
- fs/ext4/super.c | 7 +++++++
- 1 file changed, 7 insertions(+)
+ fs/ext4/super.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
-index e72145c4ae5a0..25cd0d662e31b 100644
+index cf2c8cf507780..68070b1859803 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
-@@ -3582,6 +3582,13 @@ int ext4_feature_set_ok(struct super_block *sb, int readonly)
- "mounted without CONFIG_UNICODE");
- return 0;
+@@ -3559,6 +3559,14 @@ int ext4_feature_set_ok(struct super_block *sb, int readonly)
}
+ #endif
+
+ if (EXT4_SB(sb)->s_es->s_def_hash_version == DX_HASH_SIPHASH &&
+ !ext4_has_feature_casefold(sb)) {
+ ext4_msg(sb, KERN_ERR,
@@ -24,6 +27,10 @@
+ "mounted with siphash");
+ return 0;
+ }
-
++
if (readonly)
return 1;
+
+--
+2.33.8
+
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.11.y | Failed (branch not found) | N/A |
| stable/linux-6.6.y | Failed (branch not found) | N/A |
| stable/linux-6.1.y | Failed (branch not found) | N/A |
| stable/linux-5.15.y | Failed (branch not found) | N/A |
| stable/linux-5.10.y | Failed (branch not found) | N/A |
| stable/linux-5.4.y | Failed (branch not found) | N/A |
| stable/linux-4.19.y | Failed (branch not found) | N/A |
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH 3/3] ext4: fix error message when rejecting the default hash
2024-11-18 10:20 ` [PATCH 3/3] ext4: fix error message when rejecting the default hash Vasiliy Kovalev
@ 2024-11-19 4:36 ` Sasha Levin
0 siblings, 0 replies; 7+ messages in thread
From: Sasha Levin @ 2024-11-19 4:36 UTC (permalink / raw)
To: stable; +Cc: Vasiliy Kovalev, Sasha Levin
[ Sasha's backport helper bot ]
Hi,
The upstream commit SHA1 provided is correct: a2187431c395cdfbf144e3536f25468c64fc7cfa
WARNING: Author mismatch between patch and upstream commit:
Backport author: Vasiliy Kovalev <kovalev@altlinux.org>
Commit author: Gabriel Krisman Bertazi <krisman@suse.de>
Commit in newer trees:
|-----------------|----------------------------------------------|
| 6.11.y | Present (different SHA1: b5778b2b428a) |
|-----------------|----------------------------------------------|
Note: The patch differs from the upstream commit:
---
--- - 2024-11-18 22:36:26.886622930 -0500
+++ /tmp/tmp.pApf2ytKkR 2024-11-18 22:36:26.882290161 -0500
@@ -1,3 +1,5 @@
+[ Upstream commit a2187431c395cdfbf144e3536f25468c64fc7cfa ]
+
Commit 985b67cd8639 ("ext4: filesystems without casefold feature cannot
be mounted with siphash") properly rejects volumes where
s_def_hash_version is set to DX_HASH_SIPHASH, but the check and the
@@ -11,16 +13,17 @@
Signed-off-by: Gabriel Krisman Bertazi <krisman@suse.de>
Link: https://patch.msgid.link/87jzg1en6j.fsf_-_@mailhost.krisman.be
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Vasiliy Kovalev <kovalev@altlinux.org>
---
fs/ext4/ext4.h | 1 +
- fs/ext4/super.c | 27 +++++++++++++++++----------
- 2 files changed, 18 insertions(+), 10 deletions(-)
+ fs/ext4/super.c | 28 +++++++++++++++++-----------
+ 2 files changed, 18 insertions(+), 11 deletions(-)
diff --git a/fs/ext4/ext4.h b/fs/ext4/ext4.h
-index 481ece3660eb7..7ac668d4ce83c 100644
+index 72abb8d6caf75..d5706aedf4fef 100644
--- a/fs/ext4/ext4.h
+++ b/fs/ext4/ext4.h
-@@ -2462,6 +2462,7 @@ static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize)
+@@ -2449,6 +2449,7 @@ static inline __le16 ext4_rec_len_to_disk(unsigned len, unsigned blocksize)
#define DX_HASH_HALF_MD4_UNSIGNED 4
#define DX_HASH_TEA_UNSIGNED 5
#define DX_HASH_SIPHASH 6
@@ -29,13 +32,13 @@
static inline u32 ext4_chksum(struct ext4_sb_info *sbi, u32 crc,
const void *address, unsigned int length)
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
-index 58423e6bf3d07..adc5046fe9dd5 100644
+index 68070b1859803..3e4b9bf101454 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
-@@ -3583,13 +3583,6 @@ int ext4_feature_set_ok(struct super_block *sb, int readonly)
- "mounted without CONFIG_UNICODE");
- return 0;
+@@ -3559,14 +3559,6 @@ int ext4_feature_set_ok(struct super_block *sb, int readonly)
}
+ #endif
+
- if (EXT4_SB(sb)->s_es->s_def_hash_version == DX_HASH_SIPHASH &&
- !ext4_has_feature_casefold(sb)) {
- ext4_msg(sb, KERN_ERR,
@@ -43,10 +46,11 @@
- "mounted with siphash");
- return 0;
- }
-
+-
if (readonly)
return 1;
-@@ -5095,16 +5088,27 @@ static int ext4_load_super(struct super_block *sb, ext4_fsblk_t *lsb,
+
+@@ -5050,16 +5042,27 @@ static int ext4_load_super(struct super_block *sb, ext4_fsblk_t *lsb,
return ret;
}
@@ -76,22 +80,25 @@
if (ext4_has_feature_dir_index(sb)) {
i = le32_to_cpu(es->s_flags);
if (i & EXT2_FLAGS_UNSIGNED_HASH)
-@@ -5122,6 +5126,7 @@ static void ext4_hash_info_init(struct super_block *sb)
+@@ -5077,6 +5080,7 @@ static void ext4_hash_info_init(struct super_block *sb)
#endif
}
}
+ return 0;
}
- static int ext4_block_group_meta_init(struct super_block *sb, int silent)
-@@ -5257,7 +5262,9 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
- if (err)
- goto failed_mount;
+ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
+@@ -5234,7 +5238,9 @@ static int __ext4_fill_super(struct fs_context *fc, struct super_block *sb)
+ sbi->s_addr_per_block_bits = ilog2(EXT4_ADDR_PER_BLOCK(sb));
+ sbi->s_desc_per_block_bits = ilog2(EXT4_DESC_PER_BLOCK(sb));
- ext4_hash_info_init(sb);
+ err = ext4_hash_info_init(sb);
+ if (err)
+ goto failed_mount;
- err = ext4_handle_clustersize(sb);
- if (err)
+ if (ext4_handle_clustersize(sb))
+ goto failed_mount;
+--
+2.33.8
+
---
Results of testing on various branches:
| Branch | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-6.11.y | Failed (branch not found) | N/A |
| stable/linux-6.6.y | Failed (branch not found) | N/A |
| stable/linux-6.1.y | Failed (branch not found) | N/A |
| stable/linux-5.15.y | Failed (branch not found) | N/A |
| stable/linux-5.10.y | Failed (branch not found) | N/A |
| stable/linux-5.4.y | Failed (branch not found) | N/A |
| stable/linux-4.19.y | Failed (branch not found) | N/A |
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2024-11-19 4:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-18 10:20 [PATCH 6.1.y 0/3] ext4: Fix warning related to siphash and ext4 filesystem mounting Vasiliy Kovalev
2024-11-18 10:20 ` [PATCH 1/3] ext4: factor out ext4_hash_info_init() Vasiliy Kovalev
2024-11-19 4:36 ` Sasha Levin
2024-11-18 10:20 ` [PATCH 2/3] ext4: filesystems without casefold feature cannot be mounted with siphash Vasiliy Kovalev
2024-11-19 4:36 ` Sasha Levin
2024-11-18 10:20 ` [PATCH 3/3] ext4: fix error message when rejecting the default hash Vasiliy Kovalev
2024-11-19 4:36 ` Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox