From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from air.basealt.ru (air.basealt.ru [193.43.8.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 64D441991C8 for ; Mon, 18 Nov 2024 10:21:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.43.8.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731925261; cv=none; b=erZ9UqqlK/aUDeUCTE//J8+PDMF13qZ1/qrVmtZpA7+3KHSK9i2PV5lxDuaKS+1GCZ8s5s5rUNHayL6UZ9dMKH7ncEygOptLC6Ab5cEaVQHg9TJoWTQqVty0H6S+FchOftzFLX3oNPJk3BLS+dHy1hjhMHs7RHLxwzmFi/7u+0M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731925261; c=relaxed/simple; bh=Iy2Gvq6LLru+B142klb6yQpukUOOmTYNXyzt7ruXzaM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=FhcmnnafuR5T4JCnwPXREx1U2jHOaeK9zmPUOLvqwlIrdDK45CQB+xOGg1Yp2nowZSbriM0XoxJ6ePKOx1GsPtU2nFN8y//jVUT1d4bK++O1vZTAFb212L1earZB9DiGs5I5qSUQvyQ4NFkM3u2zCOCtcO+AYGvvDy5x4KRniz0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=altlinux.org; spf=pass smtp.mailfrom=altlinux.org; arc=none smtp.client-ip=193.43.8.18 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=altlinux.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=altlinux.org Received: from altlinux.malta.altlinux.ru (obninsk.basealt.ru [217.15.195.17]) by air.basealt.ru (Postfix) with ESMTPSA id 8779F23391; Mon, 18 Nov 2024 13:20:58 +0300 (MSK) From: Vasiliy Kovalev To: Greg Kroah-Hartman , Sasha Levin , 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 Message-Id: <20241118102050.16077-3-kovalev@altlinux.org> X-Mailer: git-send-email 2.33.8 In-Reply-To: <20241118102050.16077-1-kovalev@altlinux.org> References: <20241118102050.16077-1-kovalev@altlinux.org> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Lizhi Xu [ 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 Link: https://patch.msgid.link/20240605012335.44086-1-lizhi.xu@windriver.com Signed-off-by: Theodore Ts'o Signed-off-by: Vasiliy Kovalev --- 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 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EC1D214E2E2 for ; Tue, 19 Nov 2024 04:36:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731990996; cv=none; b=JMqyO0n/Sff6UIOET4M70zXnM41AYf95Vipo9L9CVCAha7FLKNUoA/cKbRagbP4FCeqj9idRIcEXUr6gM0poSk7etbr/vV2lsCpFiHEDTQc4/gtRmjseBDjMhv8jLXqDKoBk99TFwHTgrIiByITMiloNhCQsGvq5Oy0Ry06zWno= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731990996; c=relaxed/simple; bh=nfVh3WG0lh5aJTr5YWaZx8HjXmvlm0FbdhnlV+O1fjs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ntd8vG7DyS8DQchTomIXfIm8mR5gkY+xIADOD4b7DnB/BjFNhHSuVjFWv9wQZ4ahPe2bUIITvRchFcjhFR8N+wCvE/gUr6VrAejO9CiEPZi4gUBaYdJajIaDloNCKyYcgV4E+xJm1TbAxleAo6e+onnNm2uzu1aMtTlFD85LFe4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ZwSqVYqv; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ZwSqVYqv" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F1E2BC4CECF; Tue, 19 Nov 2024 04:36:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1731990995; bh=nfVh3WG0lh5aJTr5YWaZx8HjXmvlm0FbdhnlV+O1fjs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZwSqVYqv5LP6YTzrXAkmRA8+kGIP0Ul6M9dgWb5+imgYXfpyD9WQrJhJKF7GEQAJN 2UHkUd+FuF3h1lVw3ff8NWSmaE+yvjFvd1wgq5Z3IoB0uYOiwcSFpZIoRVbYWzR/Y/ JhbTWUXK3LXFoNcOPhlgQemVnlWTUO+TrZI5BObwUehYazarQ4KXJ1AAD4XN+XJ1bR 7JfJsMknk4Q12NxxWSmYElxrk860dQD8S5CXPUIcXjxyCG2RSPpqMn9RRJ8atWW/C5 9sXsKcB0DLvp0bsoi8AaQzTXloG8XwztdqFG3JKaaZf76BNx5iYDbTtdz31m9lz0bg t7xtzQNxhUDOw== From: Sasha Levin To: stable@vger.kernel.org Cc: Vasiliy Kovalev , Sasha Levin Subject: Re: [PATCH 2/3] ext4: filesystems without casefold feature cannot be mounted with siphash Date: Mon, 18 Nov 2024 23:36:33 -0500 Message-ID: <20241118102050.16077-3-kovalev@altlinux.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241118102050.16077-3-kovalev@altlinux.org> References: Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID: <20241119043633.DV1tYGmeGmvRV4edZZkUCoy_s3dFB6wg2KyGJGYNe4w@z> [ 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 Commit author: Lizhi Xu 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 Link: https://patch.msgid.link/20240605012335.44086-1-lizhi.xu@windriver.com Signed-off-by: Theodore Ts'o +Signed-off-by: Vasiliy Kovalev --- - 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 |