* [syzbot] [gfs2?] KASAN: null-ptr-deref Write in gfs2_trans_add_revoke
@ 2025-07-31 18:10 syzbot
2025-08-01 3:48 ` Forwarded: " syzbot
2025-08-01 4:12 ` [PATCH] gfs2: Correct use of trans Lizhi Xu
0 siblings, 2 replies; 3+ messages in thread
From: syzbot @ 2025-07-31 18:10 UTC (permalink / raw)
To: agruenba, gfs2, linux-kernel, syzkaller-bugs
Hello,
syzbot found the following issue on:
HEAD commit: 260f6f4fda93 Merge tag 'drm-next-2025-07-30' of https://gi..
git tree: upstream
console output: https://syzkaller.appspot.com/x/log.txt?x=1436e9bc580000
kernel config: https://syzkaller.appspot.com/x/.config?x=3e6923811cbcd88f
dashboard link: https://syzkaller.appspot.com/bug?extid=f2b9fe431c853e793948
compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
syz repro: https://syzkaller.appspot.com/x/repro.syz?x=10a93ca2580000
C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12089ca2580000
Downloadable assets:
disk image (non-bootable): https://storage.googleapis.com/syzbot-assets/d900f083ada3/non_bootable_disk-260f6f4f.raw.xz
vmlinux: https://storage.googleapis.com/syzbot-assets/28b1dc006a89/vmlinux-260f6f4f.xz
kernel image: https://storage.googleapis.com/syzbot-assets/dcbc50612705/bzImage-260f6f4f.xz
mounted in repro #1: https://storage.googleapis.com/syzbot-assets/f2243f65af89/mount_0.gz
fsck result: OK (log: https://syzkaller.appspot.com/x/fsck.log?x=10089ca2580000)
mounted in repro #2: https://storage.googleapis.com/syzbot-assets/c6557c77eded/mount_8.gz
fsck result: OK (log: https://syzkaller.appspot.com/x/fsck.log?x=169dc834580000)
IMPORTANT: if you fix the issue, please add the following tag to the commit:
Reported-by: syzbot+f2b9fe431c853e793948@syzkaller.appspotmail.com
gfs2: fsid=syz:syz.0: first mount done, others may mount
==================================================================
BUG: KASAN: null-ptr-deref in instrument_atomic_write include/linux/instrumented.h:82 [inline]
BUG: KASAN: null-ptr-deref in set_bit include/asm-generic/bitops/instrumented-atomic.h:28 [inline]
BUG: KASAN: null-ptr-deref in gfs2_trans_add_revoke+0x8c/0xe0 fs/gfs2/trans.c:321
Write of size 8 at addr 0000000000000018 by task syz.0.17/5566
CPU: 0 UID: 0 PID: 5566 Comm: syz.0.17 Not tainted 6.16.0-syzkaller-08685-g260f6f4fda93 #0 PREEMPT(full)
Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.16.3-debian-1.16.3-2~bpo12+1 04/01/2014
Call Trace:
<TASK>
dump_stack_lvl+0x189/0x250 lib/dump_stack.c:120
kasan_report+0x118/0x150 mm/kasan/report.c:595
check_region_inline mm/kasan/generic.c:-1 [inline]
kasan_check_range+0x2b0/0x2c0 mm/kasan/generic.c:189
instrument_atomic_write include/linux/instrumented.h:82 [inline]
set_bit include/asm-generic/bitops/instrumented-atomic.h:28 [inline]
gfs2_trans_add_revoke+0x8c/0xe0 fs/gfs2/trans.c:321
gfs2_remove_from_journal+0x43e/0x6d0 fs/gfs2/meta_io.c:366
gfs2_discard fs/gfs2/aops.c:597 [inline]
gfs2_invalidate_folio+0x579/0x750 fs/gfs2/aops.c:631
folio_invalidate mm/truncate.c:140 [inline]
truncate_cleanup_folio+0x2d5/0x430 mm/truncate.c:160
truncate_inode_pages_range+0x233/0xda0 mm/truncate.c:379
do_gfs2_set_flags fs/gfs2/file.c:254 [inline]
gfs2_fileattr_set+0x80a/0x9b0 fs/gfs2/file.c:311
vfs_fileattr_set+0x92f/0xb90 fs/file_attr.c:298
ioctl_setflags+0x17b/0x200 fs/file_attr.c:336
do_vfs_ioctl+0x8ed/0x1430 fs/ioctl.c:561
__do_sys_ioctl fs/ioctl.c:596 [inline]
__se_sys_ioctl+0x82/0x170 fs/ioctl.c:584
do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline]
do_syscall_64+0xfa/0x3b0 arch/x86/entry/syscall_64.c:94
entry_SYSCALL_64_after_hwframe+0x77/0x7f
RIP: 0033:0x7f55c3b8eb69
Code: ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 a8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007ffea6c68328 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
RAX: ffffffffffffffda RBX: 00007f55c3db5fa0 RCX: 00007f55c3b8eb69
RDX: 0000200000000000 RSI: 0000000040086602 RDI: 0000000000000005
RBP: 00007f55c3c11df1 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007f55c3db5fa0 R14: 00007f55c3db5fa0 R15: 0000000000000003
</TASK>
==================================================================
---
This report is generated by a bot. It may contain errors.
See https://goo.gl/tpsmEJ for more information about syzbot.
syzbot engineers can be reached at syzkaller@googlegroups.com.
syzbot will keep track of this issue. See:
https://goo.gl/tpsmEJ#status for how to communicate with syzbot.
If the report is already addressed, let syzbot know by replying with:
#syz fix: exact-commit-title
If you want syzbot to run the reproducer, reply with:
#syz test: git://repo/address.git branch-or-commit-hash
If you attach or paste a git patch, syzbot will apply it before testing.
If you want to overwrite report's subsystems, reply with:
#syz set subsystems: new-subsystem
(See the list of subsystem names on the web dashboard)
If the report is a duplicate of another one, reply with:
#syz dup: exact-subject-of-another-report
If you want to undo deduplication, reply with:
#syz undup
^ permalink raw reply [flat|nested] 3+ messages in thread
* Forwarded: Re: [syzbot] [gfs2?] KASAN: null-ptr-deref Write in gfs2_trans_add_revoke
2025-07-31 18:10 [syzbot] [gfs2?] KASAN: null-ptr-deref Write in gfs2_trans_add_revoke syzbot
@ 2025-08-01 3:48 ` syzbot
2025-08-01 4:12 ` [PATCH] gfs2: Correct use of trans Lizhi Xu
1 sibling, 0 replies; 3+ messages in thread
From: syzbot @ 2025-08-01 3:48 UTC (permalink / raw)
To: linux-kernel
For archival purposes, forwarding an incoming command email to
linux-kernel@vger.kernel.org.
***
Subject: Re: [syzbot] [gfs2?] KASAN: null-ptr-deref Write in gfs2_trans_add_revoke
Author: lizhi.xu@windriver.com
#syz test
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c
index 075f7e9abe47..d1a34f928a18 100644
--- a/fs/gfs2/trans.c
+++ b/fs/gfs2/trans.c
@@ -314,7 +314,7 @@ void gfs2_trans_add_meta(struct gfs2_glock *gl, struct buffer_head *bh)
void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd)
{
- struct gfs2_trans *tr = current->journal_info;
+ struct gfs2_trans *tr = bd->bd_tr;
BUG_ON(!list_empty(&bd->bd_list));
gfs2_add_revoke(sdp, bd);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] gfs2: Correct use of trans
2025-07-31 18:10 [syzbot] [gfs2?] KASAN: null-ptr-deref Write in gfs2_trans_add_revoke syzbot
2025-08-01 3:48 ` Forwarded: " syzbot
@ 2025-08-01 4:12 ` Lizhi Xu
1 sibling, 0 replies; 3+ messages in thread
From: Lizhi Xu @ 2025-08-01 4:12 UTC (permalink / raw)
To: syzbot+f2b9fe431c853e793948; +Cc: agruenba, gfs2, linux-kernel, syzkaller-bugs
There are too many factors interfering with current->journal_info(for
example: dirty inode, write jdata batch, etc.). When trans begins, the
current->journal_info is set to a new value, but when trans ends, it is
set to NULL.
When revoking a trans, use the trans in bufdata directly.
Fixes: 75f2b879aeb3 ("GFS2: Merge revoke adding functions")
Reported-by: syzbot+f2b9fe431c853e793948@syzkaller.appspotmail.com
Closes: https://syzkaller.appspot.com/bug?extid=f2b9fe431c853e793948
Tested-by: syzbot+f2b9fe431c853e793948@syzkaller.appspotmail.com
Signed-off-by: Lizhi Xu <lizhi.xu@windriver.com>
---
fs/gfs2/trans.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/gfs2/trans.c b/fs/gfs2/trans.c
index 075f7e9abe47..d1a34f928a18 100644
--- a/fs/gfs2/trans.c
+++ b/fs/gfs2/trans.c
@@ -314,7 +314,7 @@ void gfs2_trans_add_meta(struct gfs2_glock *gl, struct buffer_head *bh)
void gfs2_trans_add_revoke(struct gfs2_sbd *sdp, struct gfs2_bufdata *bd)
{
- struct gfs2_trans *tr = current->journal_info;
+ struct gfs2_trans *tr = bd->bd_tr;
BUG_ON(!list_empty(&bd->bd_list));
gfs2_add_revoke(sdp, bd);
--
2.43.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-08-01 4:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-31 18:10 [syzbot] [gfs2?] KASAN: null-ptr-deref Write in gfs2_trans_add_revoke syzbot
2025-08-01 3:48 ` Forwarded: " syzbot
2025-08-01 4:12 ` [PATCH] gfs2: Correct use of trans Lizhi Xu
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.