public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rafael Alejandro Diaz Cruz <rafad900@gmail.com>
To: linux-kernel@vger.kernel.org, skhan@linuxfoundation.org,
	syzkaller-bugs@googlegroups.com
Subject: [syzbot] [jfs?] [fat?] general protection fault in txEnd
Date: Fri, 27 Mar 2026 19:20:23 -0700	[thread overview]
Message-ID: <acc65wb_JOQJtuK-@tradnomic.core> (raw)

[-- Attachment #1: Type: text/plain, Size: 10 bytes --]

#syz test

[-- Attachment #2: 0001-jfs-prevent-null-log-deference-from-superblock-durin.patch --]
[-- Type: text/x-diff, Size: 1310 bytes --]

From b530db0e1844ca2b8fecf527dd5d5457e329adf0 Mon Sep 17 00:00:00 2001
From: rafad900 <19312533+rafad900@users.noreply.github.com>
Date: Fri, 27 Mar 2026 18:58:45 -0700
Subject: [PATCH] jfs: prevent null log deference from superblock during read
 only mode

Its not possible to use jfs_create() while the file system is in read
only mode. However, there is not a way for jfs_create() to handle this case
when txBegin fails. So jfs_create() continues to with the changes to the
filesystem and tries to txCommit() them, but when trying to write the changes
to the ->log of the superblock, we reach an error telling us that system
cannot write and enters panic.

Signed-off-by: rafad900 <19312533+rafad900@users.noreply.github.com>
---
 fs/jfs/namei.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 60c4a0e0fca5..25b303276b82 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -97,6 +97,10 @@ 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");
+		return -EROFS;
+	}
 
 	mutex_lock_nested(&JFS_IP(dip)->commit_mutex, COMMIT_MUTEX_PARENT);
 	mutex_lock_nested(&JFS_IP(ip)->commit_mutex, COMMIT_MUTEX_CHILD);
-- 
2.43.0


             reply	other threads:[~2026-03-28  2:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-28  2:20 Rafael Alejandro Diaz Cruz [this message]
2026-03-29 11:07 ` [syzbot] [jfs] general protection fault in txEnd syzbot
  -- strict thread matches above, loose matches on Subject: below --
2022-12-23 23:37 [syzbot] [jfs?] [fat?] " syzbot
2023-03-30 10:03 ` Aleksandr Nogikh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=acc65wb_JOQJtuK-@tradnomic.core \
    --to=rafad900@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=skhan@linuxfoundation.org \
    --cc=syzkaller-bugs@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox