From nobody Fri Apr 3 10:17:22 2026 Received: from mail-oo1-f69.google.com (mail-oo1-f69.google.com [209.85.161.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D8EC3290D8 for ; Tue, 24 Mar 2026 09:27:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.69 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774344486; cv=none; b=oPYWPV2ILwWMeKI0elGkWRWslg5Jt5oWHWLHKdrtig2hwiYUsbJo9evx1dVfCofEsAdaNXPanLWOnOc5LiApr4SpW/I/MTRDKRl+EZhBBHInLA9rf33enyYCxBxJ4VbqrW30SjCF5TdpHDE3gSjOFW00osldaz/DKrIElhFWkS4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774344486; c=relaxed/simple; bh=roQVVTD/eiIegjJEKHZrSfslkDyXOhihIbh/DmTSqgc=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=XLC8SL4PHIxarwmUP8/6UpJC0gMQGloadX5yUXIh11vaxEC5k0znvzQUJ80C3I2DDleyaCLA9iq8IuCtWx/9j2zGoWj0whRQDyG/orQM1NE5njEGHDdt229xeUTcMPUfMdvaphgWdZB2sY4nJ4WZK+lRvprdRXi9hV7T4LFfh6c= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com; arc=none smtp.client-ip=209.85.161.69 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=syzkaller.appspotmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=M3KW2WVRGUFZ5GODRSRYTGD7.apphosting.bounces.google.com Received: by mail-oo1-f69.google.com with SMTP id 006d021491bc7-67deac23e02so15426324eaf.2 for ; Tue, 24 Mar 2026 02:27:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774344479; x=1774949279; h=to:from:subject:message-id:in-reply-to:date:mime-version :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=3MXT0Wr9hKbwjmp5N4xVbEnRk2zxXLxY45+Cndvd3XM=; b=TYNYjjEBEIQe2Ls8+88WnaQaTiq6oPouYnBBC1Rs3I35WCZSmbH4/X134x4Hta6GbY VlCmPOq2KtKbUR7CLxpu04GICZZZv9A5B0qrFOftEvzVDT5CghOAA/A+4LCsOKO2Jeis ktjNqFauQjJZvCTb3LeION807lkO1M7wk57TZtSWY1efvliXKH3+LmmsCY4GlvuLylbZ cYlMq3quyc7UBelrSREXWEPLX4iF8wvPlzWOGwn87gj3FN/Y4PaNS90dAIlngsU+Vv7g WP/vO21SwQW1XjRQbCsrvHUlibhZjUkm6UK9NrGUatnc2pDNfBygCTMUwnzmo3kDcABc xYlg== X-Gm-Message-State: AOJu0YxG3L9k4YidvT3mQtSKp/r6zM/fLj1yYu6nGwLcpEV/CEdRsQj7 aaTKuYevKAoISLvFLyqJ7M1mEVxnrQF7vkTLM+QWb5+PU3kqS1nxQ/FeDwOkivEZSRIrPejnWs4 L4fqD11FfAt6VUrgGPXS8hdHcdL1TyZ9qsTA2cUXGirxDJK4gCc2zsUIByAk= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a05:6820:180f:b0:67b:b872:7661 with SMTP id 006d021491bc7-67c22bd07e5mr11887402eaf.13.1774344478822; Tue, 24 Mar 2026 02:27:58 -0700 (PDT) Date: Tue, 24 Mar 2026 02:27:58 -0700 In-Reply-To: <69c19ef0.050a0220.3bf4de.00a9.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69c2591e.050a0220.3bf4de.00ae.GAE@google.com> Subject: Forwarded: [PATCH] gfs2: fix duplicate kmem_cache on repeated mount failure From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 on repeated mount failure Author: kartikey406@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.gi= t master When gfs2_fill_super() fails after the bufdata cache has been created, the error path destroys the cache via fail_bufdata but does not set sd_bufdata to NULL. The VFS then calls gfs2_put_super() as part of mount cleanup, which destroys the cache a second time, corrupting the slab state. On the next mount attempt, kmem_cache_create() finds a ghost entry with the same name and triggers a WARN, causing a kernel panic. Fix this by setting sd_bufdata to NULL after destroying it in the error path. kmem_cache_destroy(NULL) is a no-op, so the subsequent call in gfs2_put_super() becomes safe. Reported-by: syzbot+9013411dc43f3582823a@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=3D9013411dc43f3582823a Fixes: f9d6fc9557e6 ("gfs2: per-filesystem bufdata cache") Signed-off-by: Deepanshu Kartikey --- fs/gfs2/lops.c | 3 +++ fs/gfs2/ops_fstype.c | 1 + 2 files changed, 4 insertions(+) diff --git a/fs/gfs2/lops.c b/fs/gfs2/lops.c index 797931eb5845..005584311eff 100644 --- a/fs/gfs2/lops.c +++ b/fs/gfs2/lops.c @@ -467,6 +467,9 @@ static void gfs2_jhead_process_page(struct gfs2_jdesc *= jd, unsigned long index, =20 folio =3D filemap_get_folio(jd->jd_inode->i_mapping, index); =20 + if (IS_ERR(folio)) + return; + folio_wait_locked(folio); if (!folio_test_uptodate(folio)) *done =3D true; diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index b44adb40635d..4cff08fa3b50 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -1315,6 +1315,7 @@ static int gfs2_fill_super(struct super_block *sb, st= ruct fs_context *fc) gfs2_sys_fs_del(sdp); fail_bufdata: kmem_cache_destroy(sdp->sd_bufdata); + sdp->sd_bufdata =3D NULL; fail_delete_wq: destroy_workqueue(sdp->sd_delete_wq); fail_glock_wq: --=20 2.43.0