Skip to contentSkip to conversation

general protection fault in txEnd

syzbot Rafael Alejandro Diaz Cruz 2 participants 2 messages Mar 30 – Mar 31 JFS filesystem

lore
Share & tools
lore
#0 lore raw

#syz test

From da93920ddc6ccfe238f98e6e060700566f4052c0 Mon Sep 17 00:00:00 2001
From: rafad900 <[email protected]>
Date: Mon, 30 Mar 2026 13:33:13 -0700
Subject: [PATCH] jfs: prevent null log deference from superblock during
read only mode

Clearing the inode pointer is necessary to ensure no memory leaks after txBegin fails to initialize the superblock during read only mode.

---
 fs/jfs/namei.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
fs/jfs/namei.c +7 -1
index 60c4a0e0fca5..3a5f45cdeae0 100644
@@ -97,7 +97,13 @@ static int jfs_create(struct mnt_idmap *idmap, struct inode *dip,
 	}
 
 	tid = txBegin(dip->i_sb, 0);
-
+	if (tid == 0) {
+		jfs_err("jfs_create: unable to create tblk due to read only filesystem");
+		free_ea_wmap(ip);
+		clear_nlink(ip);
+		discard_new_inode(ip);
+		return -EROFS;
+	}
 	mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT);
 	mutex_lock_nested(&JFS_IP(ip)->commit_mutex, COMMIT_MUTEX_CHILD);
 
Signature · 1 line
2.43.0
syzbot Tested-by
#1 lore raw
syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Hello,

syzbot has tested the proposed patch and the reproducer did not trigger any issue:

Tested on:

commit:         d0c3bcd5 Merge tag 'libcrypto-for-linus' of git://git...
git tree:       upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=10d0241f980000
kernel config:  https://syzkaller.appspot.com/x/.config?x=df6930c3610cf79
dashboard link: https://syzkaller.appspot.com/bug?extid=1d096d31de6a0491b55e
compiler:       Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8
patch:          https://syzkaller.appspot.com/x/patch.diff?x=13168ebf980000

Note: testing is done by a robot and is best-effort only.