Forwarded: Re: [syzbot] WARNING in hfs_bnode_create

From: syzbot

Date: Fri Apr 17 2026 - 12:28:49 EST


For archival purposes, forwarding an incoming command email to
linux-kernel@xxxxxxxxxxxxxxx, syzkaller-bugs@xxxxxxxxxxxxxxxx.

***

Subject: Re: [syzbot] WARNING in hfs_bnode_create
Author: tristmd@xxxxxxxxx

#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>From 89ec6a61f81d25f4bf256b4747be2dec6a36627a Mon Sep 17 00:00:00 2001
From: Tristan Madani <tristan@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 17 Apr 2026 16:15:20 +0000
Subject: [PATCH] hfs: return error when bnode already hashed in
hfs_bnode_create()
hfs_bnode_create() uses WARN_ON(1) and returns the existing node
when a bnode is already hashed. On corrupted filesystems this
triggers repeated kernel WARNINGs. Replace with ERR_PTR(-EIO)
to properly signal the error to callers.
Reported-by: syzbot+a19ca73b21fe8bc69101@xxxxxxxxxxxxxxxxxxxxxxxxx
Closes: https://syzkaller.appspot.com/bug?extid=a19ca73b21fe8bc69101
Signed-off-by: Tristan Madani <tristan@xxxxxxxxxxxxxxxxxxx>
---
fs/hfs/bnode.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/fs/hfs/bnode.c b/fs/hfs/bnode.c
index 13d58c5..255db8e 100644
--- a/fs/hfs/bnode.c
+++ b/fs/hfs/bnode.c
@@ -517,8 +517,7 @@ struct hfs_bnode *hfs_bnode_create(struct hfs_btree *tree, u32 num)
spin_unlock(&tree->hash_lock);
if (node) {
pr_crit("new node %u already hashed?\n", num);
- WARN_ON(1);
- return node;
+ return ERR_PTR(-EIO);
}
node = __hfs_bnode_create(tree, num);
if (!node)
--
2.47.3