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

btrfs: balance: fix potential bg lookup failure in btrfs_may_alloc_data_chunk()

[BUG]
Running btrfs balance can trigger a null-ptr-deref before relocating a
data chunk when metadata corruption leaves a chunk in the chunk tree
without a corresponding block group in the in-memory cache:

KASAN: null-ptr-deref in range [0x0000000000000088-0x000000000000008f]
RIP: 0010:btrfs_may_alloc_data_chunk+0x40/0x1c0 fs/btrfs/volumes.c:3601
Call Trace:
__btrfs_balance fs/btrfs/volumes.c:4217 [inline]
btrfs_balance+0x2516/0x42b0 fs/btrfs/volumes.c:4604
btrfs_ioctl_balance fs/btrfs/ioctl.c:3577 [inline]
btrfs_ioctl+0x25cf/0x5b90 fs/btrfs/ioctl.c:5313
...

[CAUSE]
__btrfs_balance() iterates the on-disk chunk tree and passes the chunk
logical bytenr to btrfs_may_alloc_data_chunk() before relocating a data
chunk. That helper then queries the in-memory block group cache:

cache = btrfs_lookup_block_group(fs_info, chunk_offset);
chunk_type = cache->flags; /* cache may be NULL */

A corrupt image can contain a chunk item whose matching block group
item is missing, so no block group is ever inserted into the cache. In
that case btrfs_lookup_block_group() returns NULL.

The code only guards this with ASSERT(cache), which becomes a no-op when
CONFIG_BTRFS_ASSERT is disabled. The subsequent dereference of
cache->flags therefore crashes the kernel.

[FIX]
Add a NULL check after btrfs_lookup_block_group() in
btrfs_may_alloc_data_chunk() and print and error message for clarity.
Published: 2026-09-24
Score: 5.5 Medium
EPSS: < 1% Very Low
KEV: No
Impact: Kernel Crash / Denial of Service
Action: Immediate Patch
AI Analysis

Impact

A NULL pointer dereference occurs in the BTRFS balance routine when metadata corruption leaves a chunk entry without a corresponding block group in the in‑memory cache. The lookup function returns NULL, yet the code dereferences the pointer, causing a kernel panic that brings the entire system offline. The crash is a direct result of the NULL dereference in btrfs_may_alloc_data_chunk, leading to a denial of service on the affected machine.

Affected Systems

All Linux kernel releases that include the BTRFS file‑system implementation before the patch commit 18d32b0013efba19f7ad3e5b08d7aee813d604a6 are potentially affected. This includes the Linux kernel itself, with the vendor identified as Linux. The advisory does not specify a precise kernel version range, so any kernel that has not incorporated the patch is at risk.

Risk and Exploitability

The CVSS score of 5.5 indicates moderate severity, and the EPSS score of < 1% suggests low likelihood of current exploitation. The vulnerability is not listed in CISA KEV, meaning no publicly known exploits are documented. Based on the description, it is inferred that a local attacker who can create or exploit metadata corruption and subsequently execute the btrfs balance operation could trigger the crash. The exploitation requires local access to the affected system and the ability to corrupt BTRFS metadata. Because the failure occurs within privileged kernel context, the impact is significant, potentially leading to denial of service.

Generated by OpenCVE AI on October 1, 2026 at 17:09 UTC.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Upgrade the Linux kernel to a release that includes the patch commit 18d32b0013efba19f7ad3e5b08d7aee813d604a6.
  • If a kernel upgrade is unavailable, disable or restrict the use of the btrfs balance command on affected volumes, or mount the volume read‑only until corruption is repaired.
  • Enable CONFIG_BTRFS_ASSERT to surface potential errors in logs and monitor for KASAN or kernel panic messages to detect and remediate corruption early.

Generated by OpenCVE AI on October 1, 2026 at 17:09 UTC.

Tracking

Sign in to view the affected projects.

Advisories
Source ID Title
Debian DLA Debian DLA DLA-4817-1 linux-6.12 security update
Debian DSA Debian DSA DSA-6528-1 linux security update
History

Sat, 03 Oct 2026 11:15:00 +0000


Tue, 29 Sep 2026 13:15:00 +0000

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Low


Fri, 25 Sep 2026 05:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-476

Thu, 24 Sep 2026 16:30:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: btrfs: balance: fix potential bg lookup failure in btrfs_may_alloc_data_chunk() [BUG] Running btrfs balance can trigger a null-ptr-deref before relocating a data chunk when metadata corruption leaves a chunk in the chunk tree without a corresponding block group in the in-memory cache: KASAN: null-ptr-deref in range [0x0000000000000088-0x000000000000008f] RIP: 0010:btrfs_may_alloc_data_chunk+0x40/0x1c0 fs/btrfs/volumes.c:3601 Call Trace: __btrfs_balance fs/btrfs/volumes.c:4217 [inline] btrfs_balance+0x2516/0x42b0 fs/btrfs/volumes.c:4604 btrfs_ioctl_balance fs/btrfs/ioctl.c:3577 [inline] btrfs_ioctl+0x25cf/0x5b90 fs/btrfs/ioctl.c:5313 ... [CAUSE] __btrfs_balance() iterates the on-disk chunk tree and passes the chunk logical bytenr to btrfs_may_alloc_data_chunk() before relocating a data chunk. That helper then queries the in-memory block group cache: cache = btrfs_lookup_block_group(fs_info, chunk_offset); chunk_type = cache->flags; /* cache may be NULL */ A corrupt image can contain a chunk item whose matching block group item is missing, so no block group is ever inserted into the cache. In that case btrfs_lookup_block_group() returns NULL. The code only guards this with ASSERT(cache), which becomes a no-op when CONFIG_BTRFS_ASSERT is disabled. The subsequent dereference of cache->flags therefore crashes the kernel. [FIX] Add a NULL check after btrfs_lookup_block_group() in btrfs_may_alloc_data_chunk() and print and error message for clarity.
Title btrfs: balance: fix potential bg lookup failure in btrfs_may_alloc_data_chunk()
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References

Subscriptions

Linux Linux Kernel
cve-icon MITRE

Status: PUBLISHED

Assigner: Linux

Published:

Updated: 2026-10-03T10:58:07.862Z

Reserved: 2026-09-24T14:53:16.867Z

Link: CVE-2026-97416

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-09-24T17:17:19.340

Modified: 2026-10-03T11:17:53.617

Link: CVE-2026-97416

cve-icon Redhat

Severity : Low

Publid Date: 2026-09-24T00:00:00Z

Links: CVE-2026-97416 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-10-01T17:15:10Z

Weaknesses