* [syzbot] [gfs2?] WARNING in gfs2_fill_super @ 2026-03-24 15:38 syzbot 2026-03-24 23:34 ` Forwarded: [PATCH] gfs2: fix missing kmem_cache_destroy() of sd_bufdata in gfs2_kill_sb() syzbot 2026-03-25 0:37 ` Forwarded: [PATCH] gfs2: fix duplicate kmem_cache name on concurrent mounts syzbot 0 siblings, 2 replies; 3+ messages in thread From: syzbot @ 2026-03-24 15:38 UTC (permalink / raw) To: agruenba, gfs2, linux-kernel, syzkaller-bugs Hello, syzbot found the following issue on: HEAD commit: 09c0f7f1bcdb Add linux-next specific files for 20260323 git tree: linux-next console output: https://syzkaller.appspot.com/x/log.txt?x=142ade02580000 kernel config: https://syzkaller.appspot.com/x/.config?x=c0c30527ccbcb0f2 dashboard link: https://syzkaller.appspot.com/bug?extid=b441db1854c360b83221 compiler: Debian clang version 21.1.8 (++20251221033036+2078da43e25a-1~exp1~20251221153213.50), Debian LLD 21.1.8 syz repro: https://syzkaller.appspot.com/x/repro.syz?x=145e16da580000 C reproducer: https://syzkaller.appspot.com/x/repro.c?x=16b33b52580000 Downloadable assets: disk image: https://storage.googleapis.com/syzbot-assets/c320a7a1bc69/disk-09c0f7f1.raw.xz vmlinux: https://storage.googleapis.com/syzbot-assets/4a5b231960d2/vmlinux-09c0f7f1.xz kernel image: https://storage.googleapis.com/syzbot-assets/8e2b84b9674d/bzImage-09c0f7f1.xz mounted in repro: https://storage.googleapis.com/syzbot-assets/a4941369e2d2/mount_0.gz fsck result: failed (log: https://syzkaller.appspot.com/x/fsck.log?x=170daa06580000) IMPORTANT: if you fix the issue, please add the following tag to the commit: Reported-by: syzbot+b441db1854c360b83221@syzkaller.appspotmail.com loop4: detected capacity change from 0 to 32768 ------------[ cut here ]------------ kmem_cache of name 'gfs2-bufdata/syz:syz' already exists WARNING: mm/slab_common.c:112 at kmem_cache_sanity_check mm/slab_common.c:111 [inline], CPU#1: syz.4.21/6090 WARNING: mm/slab_common.c:112 at __kmem_cache_create_args+0xac/0x440 mm/slab_common.c:352, CPU#1: syz.4.21/6090 Modules linked in: CPU: 1 UID: 0 PID: 6090 Comm: syz.4.21 Not tainted syzkaller #0 PREEMPT(full) Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 02/12/2026 RIP: 0010:kmem_cache_sanity_check mm/slab_common.c:111 [inline] RIP: 0010:__kmem_cache_create_args+0xaf/0x440 mm/slab_common.c:352 Code: 86 8e 4d 8b 24 24 49 81 fc 18 68 86 8e 74 20 49 8b 7c 24 f8 48 89 de e8 3f 5c 9c 09 85 c0 75 e2 48 8d 3d 54 70 06 0e 48 89 de <67> 48 0f b9 3a 48 89 df be 20 00 00 00 e8 df 5d 9c 09 48 85 c0 0f RSP: 0018:ffffc900025f7948 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff88807ac1dac0 RCX: 0000000000000005 RDX: 000000007ac1da04 RSI: ffff88807ac1dac0 RDI: ffffffff9016e0b0 RBP: 0000000000000000 R08: ffffffff901246f7 R09: 1ffffffff20248de R10: dffffc0000000000 R11: fffffbfff20248df R12: ffff8881442f37e0 R13: ffff88807caa0000 R14: 0000000000000050 R15: ffffc900025f7a60 FS: 000055555c597500(0000) GS:ffff888125548000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fefd604b544 CR3: 0000000035aa2000 CR4: 00000000003526f0 Call Trace: <TASK> __kmem_cache_create include/linux/slab.h:390 [inline] gfs2_fill_super+0x13a4/0x21d0 fs/gfs2/ops_fstype.c:1202 get_tree_bdev_flags+0x431/0x4f0 fs/super.c:1694 gfs2_get_tree+0x51/0x1e0 fs/gfs2/ops_fstype.c:1342 vfs_get_tree+0x92/0x2a0 fs/super.c:1754 fc_mount fs/namespace.c:1193 [inline] do_new_mount_fc fs/namespace.c:3764 [inline] do_new_mount+0x341/0xd30 fs/namespace.c:3840 do_mount fs/namespace.c:4173 [inline] __do_sys_mount fs/namespace.c:4372 [inline] __se_sys_mount+0x31d/0x420 fs/namespace.c:4349 do_syscall_x64 arch/x86/entry/syscall_64.c:63 [inline] do_syscall_64+0x14d/0xf80 arch/x86/entry/syscall_64.c:94 entry_SYSCALL_64_after_hwframe+0x77/0x7f RIP: 0033:0x7fefd5f9da0a Code: 48 c7 c2 e8 ff ff ff f7 d8 64 89 02 b8 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 40 00 49 89 ca b8 a5 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 e8 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007fff558aaf78 EFLAGS: 00000246 ORIG_RAX: 00000000000000a5 RAX: ffffffffffffffda RBX: 00007fff558ab000 RCX: 00007fefd5f9da0a RDX: 00002000000124c0 RSI: 0000200000012500 RDI: 00007fff558aafc0 RBP: 00002000000124c0 R08: 00007fff558ab000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000200000012500 R13: 00007fff558aafc0 R14: 00000000000125c7 R15: 0000200000000180 </TASK> ---------------- Code disassembly (best guess): 0: 86 8e 4d 8b 24 24 xchg %cl,0x24248b4d(%rsi) 6: 49 81 fc 18 68 86 8e cmp $0xffffffff8e866818,%r12 d: 74 20 je 0x2f f: 49 8b 7c 24 f8 mov -0x8(%r12),%rdi 14: 48 89 de mov %rbx,%rsi 17: e8 3f 5c 9c 09 call 0x99c5c5b 1c: 85 c0 test %eax,%eax 1e: 75 e2 jne 0x2 20: 48 8d 3d 54 70 06 0e lea 0xe067054(%rip),%rdi # 0xe06707b 27: 48 89 de mov %rbx,%rsi * 2a: 67 48 0f b9 3a ud1 (%edx),%rdi <-- trapping instruction 2f: 48 89 df mov %rbx,%rdi 32: be 20 00 00 00 mov $0x20,%esi 37: e8 df 5d 9c 09 call 0x99c5e1b 3c: 48 85 c0 test %rax,%rax 3f: 0f .byte 0xf --- 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: [PATCH] gfs2: fix missing kmem_cache_destroy() of sd_bufdata in gfs2_kill_sb() 2026-03-24 15:38 [syzbot] [gfs2?] WARNING in gfs2_fill_super syzbot @ 2026-03-24 23:34 ` syzbot 2026-03-25 0:37 ` Forwarded: [PATCH] gfs2: fix duplicate kmem_cache name on concurrent mounts syzbot 1 sibling, 0 replies; 3+ messages in thread From: syzbot @ 2026-03-24 23:34 UTC (permalink / raw) To: linux-kernel, syzkaller-bugs For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] gfs2: fix missing kmem_cache_destroy() of sd_bufdata in gfs2_kill_sb() Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master gfs2_fill_super() creates a per-superblock slab cache for gfs2_bufdata objects with a name derived from the filesystem name: sdp->sd_bufdata = kmem_cache_create("gfs2-bufdata/<fsname>", ...); However, gfs2_kill_sb() does not call kmem_cache_destroy() on this cache during unmount. This means the cache persists after the filesystem is unmounted, and a subsequent mount attempt will try to create a cache with the same name, triggering a warning in kmem_cache_sanity_check(): kmem_cache of name 'gfs2-bufdata/syz:syz' already exists WARNING: mm/slab_common.c:112 The error path in gfs2_fill_super() already handles this correctly via the fail_bufdata label. Add the missing kmem_cache_destroy() call to gfs2_kill_sb() to fix the leak on the normal unmount path. Reported-by: syzbot+b441db1854c360b83221@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=b441db1854c360b83221 Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com> --- fs/gfs2/ops_fstype.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index b44adb40635d..38e4a9dc96bc 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -1803,7 +1803,7 @@ static void gfs2_kill_sb(struct super_block *sb) set_bit(SDF_KILL, &sdp->sd_flags); gfs2_flush_delete_work(sdp); destroy_workqueue(sdp->sd_delete_wq); - + kmem_cache_destroy(sdp->sd_bufdata); kill_block_super(sb); } -- 2.43.0 ^ permalink raw reply [flat|nested] 3+ messages in thread
* Forwarded: [PATCH] gfs2: fix duplicate kmem_cache name on concurrent mounts 2026-03-24 15:38 [syzbot] [gfs2?] WARNING in gfs2_fill_super syzbot 2026-03-24 23:34 ` Forwarded: [PATCH] gfs2: fix missing kmem_cache_destroy() of sd_bufdata in gfs2_kill_sb() syzbot @ 2026-03-25 0:37 ` syzbot 1 sibling, 0 replies; 3+ messages in thread From: syzbot @ 2026-03-25 0:37 UTC (permalink / raw) To: linux-kernel, syzkaller-bugs For archival purposes, forwarding an incoming command email to linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com. *** Subject: [PATCH] gfs2: fix duplicate kmem_cache name on concurrent mounts Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master When gfs2_fill_super() creates the per-filesystem bufdata cache, it uses sd_fsname as part of the cache name: sdp->sd_bufdata = kmem_cache_create("gfs2-bufdata/<fsname>", ...); At this point sd_fsname is set from sd_table_name (e.g. "syz:syz"), which is the same for all concurrent mounts of the same device. The unique suffix (.s for spectator, .N for journal ID) is only added to sd_fsname AFTER wait_on_journal() completes, since the journal ID is assigned by the locking subsystem during mount. With multiple concurrent mounts of the same device (as triggered by syzkaller with procs:5), multiple calls to gfs2_fill_super() all try to create a cache named "gfs2-bufdata/syz:syz" before any of them reaches the point where sd_fsname becomes unique, triggering: kmem_cache of name 'gfs2-bufdata/syz:syz' already exists WARNING: mm/slab_common.c:112 Fix this by moving the bufdata cache creation to after wait_on_journal() completes and sd_fsname has been updated with its unique suffix. Also move the fail_bufdata cleanup label accordingly in the error unwind path. Reported-by: syzbot+b441db1854c360b83221@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=b441db1854c360b83221 Fixes: 767e4de3ffce ("gfs2: per-filesystem bufdata cache") Signed-off-by: Deepanshu Kartikey <kartikey406@gmail.com> --- fs/gfs2/ops_fstype.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index b44adb40635d..7f8e04c11494 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -1198,17 +1198,9 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc) if (!sdp->sd_delete_wq) goto fail_glock_wq; - char *bufdata_name = kasprintf(GFP_KERNEL, "gfs2-bufdata/%s", sdp->sd_fsname); - sdp->sd_bufdata = kmem_cache_create(bufdata_name, - sizeof(struct gfs2_bufdata), - 0, 0, NULL); - kfree(bufdata_name); - if (!sdp->sd_bufdata) - goto fail_delete_wq; - error = gfs2_sys_fs_add(sdp); if (error) - goto fail_bufdata; + goto fail_delete_wq; gfs2_create_debugfs_file(sdp); @@ -1255,6 +1247,14 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc) snprintf(sdp->sd_fsname, sizeof(sdp->sd_fsname), "%s.%u", sdp->sd_table_name, sdp->sd_lockstruct.ls_jid); + char *bufdata_name = kasprintf(GFP_KERNEL, "gfs2-bufdata/%s", sdp->sd_fsname); + sdp->sd_bufdata = kmem_cache_create(bufdata_name, + sizeof(struct gfs2_bufdata), + 0, 0, NULL); + kfree(bufdata_name); + if (!sdp->sd_bufdata) + goto fail_sb; + error = init_inodes(sdp, DO); if (error) goto fail_sb; @@ -1304,6 +1304,7 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc) if (sb->s_root) dput(sb->s_root); sb->s_root = NULL; + kmem_cache_destroy(sdp->sd_bufdata); fail_locking: init_locking(sdp, &mount_gh, UNDO); fail_lm: @@ -1313,8 +1314,6 @@ static int gfs2_fill_super(struct super_block *sb, struct fs_context *fc) fail_debug: gfs2_delete_debugfs_file(sdp); gfs2_sys_fs_del(sdp); -fail_bufdata: - kmem_cache_destroy(sdp->sd_bufdata); fail_delete_wq: destroy_workqueue(sdp->sd_delete_wq); fail_glock_wq: -- 2.43.0 ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-03-25 0:37 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2026-03-24 15:38 [syzbot] [gfs2?] WARNING in gfs2_fill_super syzbot 2026-03-24 23:34 ` Forwarded: [PATCH] gfs2: fix missing kmem_cache_destroy() of sd_bufdata in gfs2_kill_sb() syzbot 2026-03-25 0:37 ` Forwarded: [PATCH] gfs2: fix duplicate kmem_cache name on concurrent mounts syzbot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®