From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lj1-f180.google.com (mail-lj1-f180.google.com [209.85.208.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BF24B3A9636 for ; Tue, 23 Jun 2026 06:03:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782194636; cv=none; b=JRE7iWbU4bQzzWX/QUdU5zo1i8b5yLmy9yUtugo5Y2tuVzilnbCLRcdLxEoeTdN7GGf/57H+PV0YkP3RlBj1HDPOz0NE4nwpwbMFBT5BuOFV0uSrZ2U2mIysGshNFTPP6ewy37eDkJfUqZ93ymF1QSKgpPx1QUyvY3sMbULlJ9c= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782194636; c=relaxed/simple; bh=m9j85QpQOxUgSY+OkJw80gRuEfHtGh8xi8ll2e9c6h4=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=jgKOkRI/ItxDp4A8ucgEBa/LZC2arH8wcWP0cwOpJoj/1yN/hlYKP650FZv0QVb7XZUx6KOWoGIeWeWmV2jNPvP7kselH030VKR8v85W7yF6pK/BHzdUSPy6DxPcnLFXJnroFSIN3eMS/RRzX6pdoSa7jNtobub/1IF5DXf2QUs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dubeyko.com; spf=pass smtp.mailfrom=dubeyko.com; dkim=pass (2048-bit key) header.d=dubeyko-com.20251104.gappssmtp.com header.i=@dubeyko-com.20251104.gappssmtp.com header.b=k/hT9ay+; arc=none smtp.client-ip=209.85.208.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=dubeyko.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=dubeyko.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=dubeyko-com.20251104.gappssmtp.com header.i=@dubeyko-com.20251104.gappssmtp.com header.b="k/hT9ay+" Received: by mail-lj1-f180.google.com with SMTP id 38308e7fff4ca-39697a4e16cso55599431fa.3 for ; Mon, 22 Jun 2026 23:03:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dubeyko-com.20251104.gappssmtp.com; s=20251104; t=1782194633; x=1782799433; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=mG0UtRgSOFKN8/2fe133iPfMXApj4VgAcN/ec2p5Rlg=; b=k/hT9ay+7mc8LoNWmAfnrL/rslxhhzxmLYTuFGGKvZ2vklswJWxfbPM9QW7NKEatuq JUmij/tqnDDuUZ8BsvxnmBy6vJ0vywYp5iMdOE/IWZP6i9zv6mAWRWxp4RonRh9uZ+Ji fx6iXsTM0Q3wYpXwfl6c7hax+IWE3sOllhlkne9lfFVj+b5WEcjb2ubCPVJCO8VsNLzC aBkLtiTafTyVZNtynhJsTIr6NYZUFFJnrQetQbNVPLD88otgOY1mF0OPI3x36W2yoQZd X5H2DA6WN9fmNBKXFWpZsIH3pr3sVBA/YcAUQhzAlHiFF+PoUFt1GXlTLnBfRHDNfsl/ H4Og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782194633; x=1782799433; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=mG0UtRgSOFKN8/2fe133iPfMXApj4VgAcN/ec2p5Rlg=; b=rJMiKFSxYDAYFSa2xrJKt1FoaUtjxf93zpdXmGWjvIpwEIQB23lkXzD7gf+wwmXGUb W/QAO/FBvn9D44YJva+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NLdo6LOOLHHayp/CX+wShxh X-Received: by 2002:a05:6512:141b:b0:5aa:6115:e4b6 with SMTP id 2adb3069b0e04-5ad5be30be7mr3490864e87.21.1782194632526; Mon, 22 Jun 2026 23:03:52 -0700 (PDT) Received: from [10.182.218.44] ([178.176.72.208]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5ad6957ff5csm479809e87.55.2026.06.22.23.03.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Jun 2026 23:03:50 -0700 (PDT) Message-ID: <925f149459d5b8d78303efc3ab61e09ece9ae5eb.camel@dubeyko.com> Subject: Re: [PATCH] hfs, hfsplus: remove WARN_ON when new bnode already hashed From: Viacheslav Dubeyko To: Aditya Srivastava , glaubitz@physik.fu-berlin.de, frank.li@vivo.com Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, syzbot+2bf21610eea63cb2ce93@syzkaller.appspotmail.com Date: Mon, 22 Jun 2026 23:03:49 -0700 In-Reply-To: <20260622171715.1697-1-aditya.ansh182@gmail.com> References: <20260622171715.1697-1-aditya.ansh182@gmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.60.1 (by Flathub.org) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Mon, 2026-06-22 at 17:17 +0000, Aditya Srivastava wrote: > From: Aditya Prakash Srivastava >=20 > Syzbot reported a warning in hfsplus_bnode_create() when mounting and > traversing a fuzzed/corrupted disk image. >=20 > The warning is triggered because the node index is found to be > already > active and hashed in the btree hash table, which indicates on-disk > metadata corruption. >=20 > Filesystem corruption should be handled gracefully by returning an > error > and logging a message, rather than triggering kernel-level warnings > (which can panic the system under panic_on_warn=3D1 configurations). > The code already prints a critical message and returns -EEXIST (or > the > node in hfs), so the WARN_ON() is completely redundant and dangerous. >=20 > Remove the WARN_ON(1) from both hfs_bnode_create() and > hfsplus_bnode_create(). >=20 > Reported-by: syzbot+2bf21610eea63cb2ce93@syzkaller.appspotmail.com > Closes: https://syzkaller.appspot.com/bug?extid=3D2bf21610eea63cb2ce93 > Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") > Signed-off-by: Aditya Prakash Srivastava > --- > =C2=A0fs/hfs/bnode.c=C2=A0=C2=A0=C2=A0=C2=A0 | 1 - > =C2=A0fs/hfsplus/bnode.c | 1 - > =C2=A02 files changed, 2 deletions(-) >=20 > diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c > index 13d58c51fc46..335834961741 100644 > --- a/fs/hfs/bnode.c > +++ b/fs/hfs/bnode.c > @@ -517,7 +517,6 @@ struct hfs_bnode *hfs_bnode_create(struct > hfs_btree *tree, u32 num) > =C2=A0 spin_unlock(&tree->hash_lock); > =C2=A0 if (node) { > =C2=A0 pr_crit("new node %u already hashed?\n", num); > - WARN_ON(1); > =C2=A0 return node; > =C2=A0 } > =C2=A0 node =3D __hfs_bnode_create(tree, num); > diff --git a/fs/hfsplus/bnode.c b/fs/hfsplus/bnode.c > index f8b5a8ae58ff..bfc2a7f53edd 100644 > --- a/fs/hfsplus/bnode.c > +++ b/fs/hfsplus/bnode.c > @@ -631,7 +631,6 @@ struct hfs_bnode *hfs_bnode_create(struct > hfs_btree *tree, u32 num) > =C2=A0 spin_unlock(&tree->hash_lock); > =C2=A0 if (node) { > =C2=A0 pr_crit("new node %u already hashed?\n", num); > - WARN_ON(1); > =C2=A0 return ERR_PTR(-EEXIST); > =C2=A0 } > =C2=A0 node =3D __hfs_bnode_create(tree, num); If we have corrupted HFS/HFS+ volume and we can detect it during the mount operation, then we should not mount the corrupted volume or mount in READ-ONLY mode. As I remember, we already have HFS+ logic that detects b-tree's map corruption for the case of node 0. We haven't this logic for HFS file system logic yet, if I remember correctly. So, you are welcomed to port this logic for HFS case. Removing WARN_ON() simply hides the potential issues. So, I don't think that we need to remove it. Thanks, Slava.