From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.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 A0D2214A60F for ; Fri, 31 Jul 2026 05:18:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.69 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785475122; cv=none; b=WmVwBJGkMDFqctxe2ixiSpiOGmcQWhh66Wz08d8y/Z28ZO+3LB1HA7k924vlYDExVxS5VpIzikVcz+DYsEPT9OQRGOCh2wUn8yw+gTnVwtzYJvBXYjCKWcac2giO0Ir6iqVe3oz4Ku/GAFT5ojZm9QU7l70UbafVNnE8EejgAGM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785475122; c=relaxed/simple; bh=z0mXHj2eo/gXgjfAsP74hGhLRqeYpQ2xGIqtJd2023o=; h=MIME-Version:Date:In-Reply-To:Message-ID:Subject:From:To: Content-Type; b=QGaIYm7EE3IT7p01rkIVapIHMVEJLjDN6uOxPgF5wfY04vuFOredllG5ohcis/x/6bR49z3x9TgSA07c7pQ2zrXSBTdDKw9dCXGTZRgzj4V3ciyNdWo/F7eP97TFQ8N7y7afmUxzdifEjKAYj0OYYRfRPY1Vyj1P05L9eAsHYHQ= 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.210.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-ot1-f69.google.com with SMTP id 46e09a7af769-7e9fc6dc091so244727a34.2 for ; Thu, 30 Jul 2026 22:18:40 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785475119; x=1786079919; h=content-type:to:from:subject:message-id:in-reply-to:date :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=j5oUynqjUVXIric6vi/QrOdNAbbxBowueZa5xozIc1A=; b=mU2Saqwxly1fwiGEMvkaMkknFkIslpNPmd73Ol3pQxArqSRLOgs/fvuN7h1xQLLrGx lq3OQIR1m4CtynN13Z+3ght93n5SIoC63Fhwu5XzeV5z21BRe4efq6pYBqdWHHOp+MgE pUh4O8l8MD9wf8ZSTvHIyUkHn2Xt6VkuNkfkcPLk8A+3PP+vjQbfDQVLcMmKKJ3th+yV 3HMgwvZgatbylrPGWs3kNqMtfvyFe6y39uX+edssHITy/7DR3jRRPWo8GHBfuGke3ZaN XqAVlYKRPgOQL96kDRb2f5YThcwbo+hZIkAykkByUODFeH2PsNnYQ/WWl5757ChSULLF m16g== X-Gm-Message-State: AOJu0Yx6u5t9NZeM6LwOHJx0KtbRKCT3NKuW+Ms4DLWYnI3u3jJXCGA7 0Lwq1VhNcFpfPLCinqdlvF03xz0lTsJesDJwuafQtL2pApHHobDuIAnO4MZO9OkZdWwYrywo74u RJRT3FBdruaSKc9rKJqeSpfSrC+lfab8+8ZmI7Tj6UgDNMyRHRG+weKv+ua4= 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:6808:5147:b0:495:da89:c578 with SMTP id 5614622812f47-4ae4c4e0316mr412519b6e.9.1785475119607; Thu, 30 Jul 2026 22:18:39 -0700 (PDT) Date: Thu, 30 Jul 2026 22:18:39 -0700 In-Reply-To: <68a70f15.050a0220.3d78fd.0024.GAE@google.com> X-Google-Appengine-App-Id: s~syzkaller X-Google-Appengine-App-Id-Alias: syzkaller Message-ID: <6a6c302f.77639fcc.3d4fd0.001b.GAE@google.com> Subject: Forwarded: [PATCH] xfs: add guard before freeing buffer log item 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: [PATCH] xfs: add guard before freeing buffer log item Author: marcelomspessoto@gmail.com #syz test: https://github.com/torvalds/linux.git master A buffer's write completion can race with the CIL walking the same checkpoint's item list during a forced shutdown's simulated commit callbacks. Whichever side reaches the item last should be the one to free it; right now completion frees it unconditionally, so the CIL walk can end up touching memory that's already gone. Fixes: d2fe5c4c8d25 ("xfs: rearrange code in xfs_buf_item.c") Signed-off-by: Marcelo Mendes Spessoto Junior --- fs/xfs/xfs_buf_item.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c index f4c5be67826e..c86c4387f52b 100644 --- a/fs/xfs/xfs_buf_item.c +++ b/fs/xfs/xfs_buf_item.c @@ -1072,6 +1072,9 @@ void xfs_buf_item_done( struct xfs_buf *bp) { + if (atomic_read(&bp->b_log_item->bli_refcount) != 0) + return; + /* * If we are forcibly shutting down, this may well be off the AIL * already. That's because we simulate the log-committed callbacks to -- 2.55.0