From: syzbot <syzbot+b441db1854c360b83221@syzkaller.appspotmail.com>
To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Forwarded: [PATCH] gfs2: fix missing kmem_cache_destroy() of sd_bufdata in gfs2_kill_sb()
Date: Tue, 24 Mar 2026 16:34:38 -0700 [thread overview]
Message-ID: <69c31f8e.a70a0220.234938.003a.GAE@google.com> (raw)
In-Reply-To: <69c2aff4.050a0220.3bf4de.00b3.GAE@google.com>
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
next prev parent reply other threads:[~2026-03-24 23:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-24 15:38 [syzbot] [gfs2?] WARNING in gfs2_fill_super syzbot
2026-03-24 23:34 ` syzbot [this message]
2026-03-25 0:37 ` Forwarded: [PATCH] gfs2: fix duplicate kmem_cache name on concurrent mounts syzbot
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=69c31f8e.a70a0220.234938.003a.GAE@google.com \
--to=syzbot+b441db1854c360b83221@syzkaller.appspotmail.com \
--cc=linux-kernel@vger.kernel.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