lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <2025050921-CVE-2025-37856-3117@gregkh>
Date: Fri,  9 May 2025 08:42:34 +0200
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: linux-cve-announce@...r.kernel.org
Cc: Greg Kroah-Hartman <gregkh@...nel.org>
Subject: CVE-2025-37856: btrfs: harden block_group::bg_list against list_del() races

From: Greg Kroah-Hartman <gregkh@...nel.org>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

btrfs: harden block_group::bg_list against list_del() races

As far as I can tell, these calls of list_del_init() on bg_list cannot
run concurrently with btrfs_mark_bg_unused() or btrfs_mark_bg_to_reclaim(),
as they are in transaction error paths and situations where the block
group is readonly.

However, if there is any chance at all of racing with mark_bg_unused(),
or a different future user of bg_list, better to be safe than sorry.

Otherwise we risk the following interleaving (bg_list refcount in parens)

T1 (some random op)                       T2 (btrfs_mark_bg_unused)
                                        !list_empty(&bg->bg_list); (1)
list_del_init(&bg->bg_list); (1)
                                        list_move_tail (1)
btrfs_put_block_group (0)
                                        btrfs_delete_unused_bgs
                                             bg = list_first_entry
                                             list_del_init(&bg->bg_list);
                                             btrfs_put_block_group(bg); (-1)

Ultimately, this results in a broken ref count that hits zero one deref
early and the real final deref underflows the refcount, resulting in a WARNING.

The Linux kernel CVE team has assigned CVE-2025-37856 to this issue.


Affected and fixed versions
===========================

	Fixed in 6.12.24 with commit bf089c4d1141b27332c092b1dcca5022c415a3b6
	Fixed in 6.13.12 with commit 909e60fb469d4101c6b08cf6e622efb062bb24a1
	Fixed in 6.14.3 with commit 185fd73e5ac06027c4be9a129e59193f6a3ef202
	Fixed in 6.15-rc1 with commit 7511e29cf1355b2c47d0effb39e463119913e2f6

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-37856
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/extent-tree.c
	fs/btrfs/transaction.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/bf089c4d1141b27332c092b1dcca5022c415a3b6
	https://git.kernel.org/stable/c/909e60fb469d4101c6b08cf6e622efb062bb24a1
	https://git.kernel.org/stable/c/185fd73e5ac06027c4be9a129e59193f6a3ef202
	https://git.kernel.org/stable/c/7511e29cf1355b2c47d0effb39e463119913e2f6

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ