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 A492617C224 for ; Mon, 18 Nov 2024 10:18:32 +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=1731925114; cv=none; b=PG9TyDxKtEway/KC3UUFV4ZrfsmMNStB42gQKw8k7qXrbQ9ydLjCYjgQ2l22nTj/2Ol16IkbYr+/UrSYfaxs0BQXfipZ+qlxV/JDeRqWdsvKfNUwKJvb8sT5FuL3ctbC4bsLGd4rReN3+VRuoczuMPfuiOwNB3ZO57mO32hy/o8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731925114; c=relaxed/simple; bh=Iy2Gvq6LLru+B142klb6yQpukUOOmTYNXyzt7ruXzaM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version; b=fiaRRnbqUyHaiJyIrzlx90aAwQQ9t4yka42UVv4oBc9hfJVw6yq4yeu9cuvvYSd/vWNiOk3sxW7I7mcO5ikHbluue1yBhCbedHK+zQKm07wa5dk3iTURzWzWbECpPRsubjtScmlgdLlibjuhwf2RM1i1FB5V+AnrW9yNRc8jRTU= 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 630382338D; Mon, 18 Nov 2024 13:18:24 +0300 (MSK) From: Vasiliy Kovalev To: Greg Kroah-Hartman , Sasha Levin , stable@vger.kernel.org Cc: kovalev@altlinux.org Subject: [PATCH 1/2] ext4: filesystems without casefold feature cannot be mounted with siphash Date: Mon, 18 Nov 2024 13:18:10 +0300 Message-Id: <20241118101811.15896-2-kovalev@altlinux.org> X-Mailer: git-send-email 2.33.8 In-Reply-To: <20241118101811.15896-1-kovalev@altlinux.org> References: <20241118101811.15896-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