Forwarded: Re: [syzbot] kernel BUG in jffs2_del_ino_cache

syzbot posted 1 patch 1 month, 4 weeks ago
There is a newer version of this series
fs/jffs2/nodelist.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Forwarded: Re: [syzbot] kernel BUG in jffs2_del_ino_cache
Posted by syzbot 1 month, 4 weeks ago
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com.

***

Subject: Re: [syzbot] kernel BUG in jffs2_del_ino_cache
Author: tristmd@gmail.com

#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>From 2e46a94bb2b935dcf0b09aa5f20ff638124cb395 Mon Sep 17 00:00:00 2001
From: Tristan Madani <tristan@talencesecurity.com>
Date: Fri, 17 Apr 2026 16:15:21 +0000
Subject: [PATCH] jffs2: replace BUG_ON with warning in jffs2_del_ino_cache()
jffs2_del_ino_cache() uses BUG_ON(old->xref) which triggers a
kernel panic when called with an inode cache entry that still has
xattr references. On corrupted filesystems this is a recoverable
condition. Replace with WARN_ON_ONCE to log the issue without
crashing.
Reported-by: syzbot+44664704c1494ad5f7a0@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=44664704c1494ad5f7a0
Signed-off-by: Tristan Madani <tristan@talencesecurity.com>
---
 fs/jffs2/nodelist.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/jffs2/nodelist.c b/fs/jffs2/nodelist.c
index b86c78d..c1dc753 100644
--- a/fs/jffs2/nodelist.c
+++ b/fs/jffs2/nodelist.c
@@ -459,7 +459,7 @@ void jffs2_del_ino_cache(struct jffs2_sb_info *c, struct jffs2_inode_cache *old)
 	struct jffs2_inode_cache **prev;
 
 #ifdef CONFIG_JFFS2_FS_XATTR
-	BUG_ON(old->xref);
+	WARN_ON_ONCE(old->xref);
 #endif
 	dbg_inocache("del %p (ino #%u)\n", old, old->ino);
 	spin_lock(&c->inocache_lock);
-- 
2.47.3