From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f72.google.com (mail-oo1-f72.google.com [209.85.161.72]) (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 CB3B83D7D97 for ; Thu, 30 Apr 2026 11:25:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.72 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777548357; cv=none; b=Z6QJybjXJAdfJj60/IhxPm3lY4AT7a6H70GhZcSxr9vvBaPX4ZAC+HfhBHeevJvQ7KPZW1KmmL/bl61MOqw1zYicraIPT5odgl3wSL2rJDJ//rkvc8uFbvf7h9FCkYrJEnnpma48Mlg4OtovmWeBuFKWYGMyoy667elYASQcjvI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777548357; c=relaxed/simple; bh=j1rxLt7xVRRkOJhd2DycGovEnwWt8Qakndg74RWn+Mg=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=Y5y3hg5nLIq+VBftL/BPok4qrCRy4F3NjIv1lPa+DxYAVzxK6HrvuK6fxh6c90UCVCpr6Dqkyns7xiGnNd/H0QjuxVxiyGuWflNuN4kgs78l3tbDSULJpoNZ1AjsQ3E4hfoukqGpB9GQ7cnZ7hQlg1oF+MIiGVBEHGnV61VG6gw= 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.72 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-f72.google.com with SMTP id 006d021491bc7-6967bd4ec48so792080eaf.1 for ; Thu, 30 Apr 2026 04:25:55 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777548355; x=1778153155; 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=/mJLjML1XJpR8Mw2/jee5hgdLFtPL1mABPd4VHX9nyI=; b=OKFuQwzai4VoZaVV+6xYvIB6fciwf1Q4WrbSNfMM6Zl9dqHCuSiLO/mSK0olqnD7+G 9jWrBJdsur8X3AKeAEMA1gSeWyu+GzfCM/3Lk7mcTPB80z3/7teoW3TRRnlRoNQkkI+s hPYjMUNZgWEG4RxtkmrZ0c4EZFC0cXYmEOqwDk3qC9HR3TYau1l86KwXvpsJXH1mbk/X Hn6fv52PwQFiKiGKfPW0xUdE2TE4byreHz89jkv9CbauB4WezHrmqx3QBl9Ls2QDVKRK J/rUt94Xs7w4ebtOYdyPqEm+yOZfyW5+L9lSRuRV/ZZJ3ICnnUbRIB1OT83LMmtN0h9m sq+A== X-Gm-Message-State: AOJu0YxbCStjAsx17a1PcyJ5Jaya63wiCHKmzvRcE+Q6B8X14PsCfN8a Ktyx7OfE7Ny8ddA+wPdqrKxBxnaJ+LBB+hWF8UrU1t6Usf+HBXLCeNs5IQXFmxeSOWxANdun7BZ OLokvtXZhMqx8QAOgwTYnaRUEYn6v7xCwshHJhEinx9O2Rz44NM6Ir24uINw= Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Received: by 2002:a4a:ee87:0:b0:694:8cb0:4efe with SMTP id 006d021491bc7-6967a5671b3mr1087700eaf.17.1777548354886; Thu, 30 Apr 2026 04:25:54 -0700 (PDT) Date: Thu, 30 Apr 2026 04:25:54 -0700 In-Reply-To: <6836e09f.a70a0220.253bc2.00c7.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <69f33c42.170a0220.3c4978.001a.GAE@google.com> Subject: Forwarded: Re: [syzbot] [gfs2?] KASAN: slab-use-after-free Write in gfs2_qd_dealloc (3) From: syzbot To: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com 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: Re: [syzbot] [gfs2?] KASAN: slab-use-after-free Write in gfs2_qd_dealloc (3) Author: tristmd@gmail.com #syz test: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master >>From bcb810e8bbe744753bc43fd4f3cb5946a3ae91ee Mon Sep 17 00:00:00 2001 From: Tristan Madani Date: Thu, 30 Apr 2026 11:05:04 +0000 Subject: [PATCH] gfs2: fix use-after-free in gfs2_qd_dealloc gfs2_qd_dealloc(), called as an RCU callback from gfs2_qd_dispose(), accesses the superblock object sdp through qd->qd_sbd after freeing qd. It does so to decrement sd_quota_count and wake up sd_kill_wait. However, by the time the RCU callback runs, gfs2_put_super() may have already freed sdp via free_sbd(). This can happen when gfs2_quota_cleanup() is called during unmount: it disposes of quota objects via call_rcu() and then waits on sd_kill_wait with a 60-second timeout. If the timeout expires, or if gfs2_gl_hash_clear() triggers additional qd_put() calls that schedule more RCU callbacks after the wait completes, gfs2_put_super() will proceed to free the superblock while RCU callbacks referencing it are still pending. Add an rcu_barrier() before free_sbd() in gfs2_put_super() to ensure all pending RCU callbacks (including gfs2_qd_dealloc) have completed before the superblock is freed. Fixes: a475c5dd16e5 ("gfs2: Free quota data objects synchronously") Cc: stable@vger.kernel.org Signed-off-by: Tristan Madani --- fs/gfs2/super.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index a2ea121331f18..4d854556b5299 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -643,6 +643,7 @@ static void gfs2_put_super(struct super_block *sb) gfs2_delete_debugfs_file(sdp); gfs2_sys_fs_del(sdp); + rcu_barrier(); free_sbd(sdp); } -- 2.47.3