Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE84E2D47EF for ; Fri, 23 Jan 2026 15:25:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769181904; cv=none; b=T9R6CZh5WvAODMSsaRbcA0tftDvqWtz5WXSKJWVbXvo6bJRr8DeJUv4hZRGbOvmsC+6oy3+bEo/Q4gft4zbWNJmZYk+7qlz0Eo+1+g6RFka9FIRdciA9ERtodmMu2AQpXBKhKbxUGx0TUeeVu4sJYpXtp3oUnspX/H7F4qPeD9Y= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769181904; c=relaxed/simple; bh=NBBWVj4YLRQanMj0utORcH3ElntMN3XikVim5hV92rk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=UNZNs/sEWasnBD09EnHrhizhWvzI8nKXBqat+nNIRWrvbU0ZxswmPp5nCqw5u6nkG651pZD1dXmkZ7PslqFEQUhRxgdMCVKBDYawWwpo1IasaXMAM+tgklUz9Z1OV5iRsttyN6EWiJZGJxEQn7RaG/aEO4Y11tlNv6CGHfRTcH0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=gZfUkHeq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="gZfUkHeq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B5325C4CEF1; Fri, 23 Jan 2026 15:25:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1769181904; bh=NBBWVj4YLRQanMj0utORcH3ElntMN3XikVim5hV92rk=; h=From:To:Cc:Subject:Date:Reply-To:From; b=gZfUkHeqVRDCEC+C/eONQvHMT50+EQvaIYl8wY4Atn0mG4hyTSnyJXnYnSvXWgZ+c MSL9h9bpoQcBVVCqwEQZYoiWQkypJiiLir754vbKswoOn2ty9n+SW4COuJSQu2+r/w E9xsmvVpeqmPVzUrMbZSCnB20hLcLemVHz6KkxuQ= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-71159: btrfs: fix use-after-free warning in btrfs_get_or_create_delayed_node() Date: Fri, 23 Jan 2026 16:24:46 +0100 Message-ID: <2026012346-CVE-2025-71159-417a@gregkh> X-Mailer: git-send-email 2.52.0 Reply-To: , Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2702; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=3RWLHTdgQmdVBlsB7br/drIZyZLLE9UNJvUZPWVxEh0=; b=owGbwMvMwCRo6H6F97bub03G02pJDJnFk/ZNslVY/DXxemvUrjOXfLYY7g1dc7hlwem5dYqRP c+WTV4yrSOWhUGQiUFWTJHlyzaeo/srDil6GdqehpnDygQyhIGLUwAmsryRYX5ezrSKaxWzGleH n5mwjPnO+dVPHpcxzGI+59BqX6F2OO/nFN2KLzuPrNrdtxoA X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: btrfs: fix use-after-free warning in btrfs_get_or_create_delayed_node() Previously, btrfs_get_or_create_delayed_node() set the delayed_node's refcount before acquiring the root->delayed_nodes lock. Commit e8513c012de7 ("btrfs: implement ref_tracker for delayed_nodes") moved refcount_set inside the critical section, which means there is no longer a memory barrier between setting the refcount and setting btrfs_inode->delayed_node. Without that barrier, the stores to node->refs and btrfs_inode->delayed_node may become visible out of order. Another thread can then read btrfs_inode->delayed_node and attempt to increment a refcount that hasn't been set yet, leading to a refcounting bug and a use-after-free warning. The fix is to move refcount_set back to where it was to take advantage of the implicit memory barrier provided by lock acquisition. Because the allocations now happen outside of the lock's critical section, they can use GFP_NOFS instead of GFP_ATOMIC. The Linux kernel CVE team has assigned CVE-2025-71159 to this issue. Affected and fixed versions =========================== Issue introduced in 6.18 with commit e8513c012de75fd65e2df5499572bc6ef3f6e409 and fixed in 6.18.6 with commit c8385851a5435f4006281828d428e5d0b0bbf8af Issue introduced in 6.18 with commit e8513c012de75fd65e2df5499572bc6ef3f6e409 and fixed in 6.19-rc5 with commit 83f59076a1ae6f5c6845d6f7ed3a1a373d883684 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2025-71159 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: fs/btrfs/delayed-inode.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/c8385851a5435f4006281828d428e5d0b0bbf8af https://git.kernel.org/stable/c/83f59076a1ae6f5c6845d6f7ed3a1a373d883684