public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [syzbot] [jfs?] [fat?] general protection fault in txEnd
@ 2026-03-30 21:15 Rafael Alejandro Diaz Cruz
  2026-03-30 21:45 ` [syzbot] [jfs] " syzbot
  0 siblings, 1 reply; 8+ messages in thread
From: Rafael Alejandro Diaz Cruz @ 2026-03-30 21:15 UTC (permalink / raw)
  To: linux-kernel, skhan, syzkaller-bugs

[-- 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: 972 bytes --]

From f5d32d2cad197e1cd5e335ec85490bda11aec429 Mon Sep 17 00:00:00 2001
From: rafad900 <19312533+rafad900@users.noreply.github.com>
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.

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

diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 25b303276b82..6d5a1f8f72ab 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -99,6 +99,9 @@ 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;
 	}
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [syzbot] [jfs?] [fat?] general protection fault in txEnd
@ 2026-03-30 23:32 Rafael Alejandro Diaz Cruz
  2026-03-31  0:19 ` [syzbot] [jfs] " syzbot
  0 siblings, 1 reply; 8+ messages in thread
From: Rafael Alejandro Diaz Cruz @ 2026-03-30 23:32 UTC (permalink / raw)
  To: linux-kernel, skhan, syzkaller-bugs

[-- 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: 1151 bytes --]

From da93920ddc6ccfe238f98e6e060700566f4052c0 Mon Sep 17 00:00:00 2001
From: rafad900 <19312533+rafad900@users.noreply.github.com>
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.

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

diff --git a/fs/jfs/namei.c b/fs/jfs/namei.c
index 60c4a0e0fca5..3a5f45cdeae0 100644
--- a/fs/jfs/namei.c
+++ b/fs/jfs/namei.c
@@ -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);
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [syzbot] [jfs?] [fat?] general protection fault in txEnd
@ 2026-03-28  2:20 Rafael Alejandro Diaz Cruz
  2026-03-29 11:07 ` [syzbot] [jfs] " syzbot
  0 siblings, 1 reply; 8+ messages in thread
From: Rafael Alejandro Diaz Cruz @ 2026-03-28  2:20 UTC (permalink / raw)
  To: linux-kernel, skhan, syzkaller-bugs

[-- 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


^ permalink raw reply related	[flat|nested] 8+ messages in thread
[parent not found: <CALp66yFze81g4MhLZfqxyqLpH0RRsHfyXcXPjWUY-G-EFWiB2g@mail.gmail.com>]

end of thread, other threads:[~2026-03-31  0:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-30 21:15 [syzbot] [jfs?] [fat?] general protection fault in txEnd Rafael Alejandro Diaz Cruz
2026-03-30 21:45 ` [syzbot] [jfs] " syzbot
  -- strict thread matches above, loose matches on Subject: below --
2026-03-30 23:32 [syzbot] [jfs?] [fat?] " Rafael Alejandro Diaz Cruz
2026-03-31  0:19 ` [syzbot] [jfs] " syzbot
2026-03-28  2:20 [syzbot] [jfs?] [fat?] " Rafael Alejandro Diaz Cruz
2026-03-29 11:07 ` [syzbot] [jfs] " syzbot
     [not found] <CALp66yFze81g4MhLZfqxyqLpH0RRsHfyXcXPjWUY-G-EFWiB2g@mail.gmail.com>
2026-03-28  1:33 ` syzbot
     [not found]   ` <CALp66yEShffuRpH4CxvanWanShtavxGtZfO0Sj8+QCaj6mO1FQ@mail.gmail.com>
2026-03-28  1:46     ` syzbot
2026-03-28  1:49     ` Rafael Alejandro Díaz Cruz
2026-03-28  1:51       ` syzbot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox