From: Vasiliy Kovalev <kovalev@altlinux.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Sasha Levin <sashal@kernel.org>,
stable@vger.kernel.org
Cc: lvc-project@linuxtesting.org, dutyrok@altlinux.org,
gerben@altlinux.org, kovalev@altlinux.org
Subject: [PATCH 2/3] ext4: filesystems without casefold feature cannot be mounted with siphash
Date: Mon, 18 Nov 2024 13:20:49 +0300 [thread overview]
Message-ID: <20241118102050.16077-3-kovalev@altlinux.org> (raw)
In-Reply-To: <20241118102050.16077-1-kovalev@altlinux.org>
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
WARNING: multiple messages have this Message-ID (diff)
From: Sasha Levin <sashal@kernel.org>
To: stable@vger.kernel.org
Cc: Vasiliy Kovalev <kovalev@altlinux.org>, Sasha Levin <sashal@kernel.org>
Subject: Re: [PATCH 2/3] ext4: filesystems without casefold feature cannot be mounted with siphash
Date: Mon, 18 Nov 2024 23:36:33 -0500 [thread overview]
Message-ID: <20241118102050.16077-3-kovalev@altlinux.org> (raw)
Message-ID: <20241119043633.DV1tYGmeGmvRV4edZZkUCoy_s3dFB6wg2KyGJGYNe4w@z> (raw)
In-Reply-To: <20241118102050.16077-3-kovalev@altlinux.org>
[ 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 |
next prev parent reply other threads:[~2024-11-18 10:21 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
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 ` Vasiliy Kovalev [this message]
2024-11-19 4:36 ` [PATCH 2/3] ext4: filesystems without casefold feature cannot be mounted with siphash 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241118102050.16077-3-kovalev@altlinux.org \
--to=kovalev@altlinux.org \
--cc=dutyrok@altlinux.org \
--cc=gerben@altlinux.org \
--cc=gregkh@linuxfoundation.org \
--cc=lvc-project@linuxtesting.org \
--cc=sashal@kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox