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

btrfs: fix invalid pointer dereference in __btrfs_run_delayed_refs()

In the beginning of the loop, we try to obtain a locked delayed ref head,
if 'locked_ref' is currently NULL, by calling btrfs_select_ref_head(),
which can return an error pointer. If the error pointer is -EAGAIN we do
a continue and go back to the beginning of the loop, which will not try
again to call btrfs_select_ref_head() since 'locked_ref' is no longer
NULL but it's ERR_PTR(-EAGAIN), and then we do:

spin_lock(&locked_ref->lock);

against a ERR_PTR(-EAGAIN) value, generating an invalid pointer
dereference.

Fix this by ensuring that 'locked_ref' is set to NULL when
btrfs_select_ref_head() returns ERR_PTR(-EAGAIN) and incrementing 'count'
as well, to prevent infinite looping. We do this by doing a goto to the
bottom of the loop that already sets 'locked_ref' to NULL and does a
cond_resched(), with an increment to 'count' right before the goto.
These measures were in place before the refactoring in commit 0110a4c43451
("btrfs: refactor __btrfs_run_delayed_refs loop") but were unintentionally
lost afterwards.
Published: 2026-08-15
Score: 7.5 High
EPSS: < 1% Very Low
KEV: No
Impact: n/a
Action: n/a
AI Analysis

Impact

A flaw in the Linux kernel’s Btrfs filesystem causes the __btrfs_run_delayed_refs loop to attempt a spin‑lock on an error pointer returned by btrfs_select_ref_head when the function returns –EAGAIN. This results in an invalid pointer dereference (CWE‑476), crashing the kernel and rebooting the system. The weakness is an instance of null pointer dereference, leading to a local denial of service by forcing a kernel panic.

Affected Systems

The vulnerability affects any Linux kernel release that incorporates the refactored __btrfs_run_delayed_refs loop without the missing null check. It is present in builds that include the commit 0110a4c43451 or older patches before the fix. Since no specific version ranges are supplied, all kernel versions that still contain the problematic loop should be considered at risk until updated.

Risk and Exploitability

The CVSS score of 7.5 indicates a high impact. The EPSS score of less than 1% suggests a low probability of exploitation, and the vulnerability is not listed in the CISA KEV catalog, implying no known widespread attacks. Exploitation would likely require local or privileged access to a system using the affected Btrfs implementation to trigger the faulting path. The result is a kernel crash, so the primary risk is a local denial of service rather than remote compromise.

Generated by OpenCVE AI on August 22, 2026 at 00:16 UTC.

Remediation

No vendor fix or workaround currently provided.

OpenCVE Recommended Actions

  • Apply a kernel update containing the fix (commit 0110a4c43451).
  • If a patch is not yet available, avoid using Btrfs for critical or untrusted workloads, or consider remounting the filesystem with options that disable delayed reference cleanup when possible.
  • Monitor kernel logs for Btrfs‑related OOPS or panic messages and investigate any abnormal reboots.

Generated by OpenCVE AI on August 22, 2026 at 00:16 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories yet.

History

Wed, 19 Aug 2026 12:15:00 +0000

Type Values Removed Values Added
Weaknesses CWE-476
References
Metrics threat_severity

None

threat_severity

Moderate


Mon, 17 Aug 2026 13:30:00 +0000

Type Values Removed Values Added
Weaknesses CWE-476

Mon, 17 Aug 2026 06:00:00 +0000

Type Values Removed Values Added
Metrics cvssV3_1

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


Sat, 15 Aug 2026 17:00:00 +0000

Type Values Removed Values Added
Weaknesses CWE-476

Sat, 15 Aug 2026 06:15:00 +0000

Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: btrfs: fix invalid pointer dereference in __btrfs_run_delayed_refs() In the beginning of the loop, we try to obtain a locked delayed ref head, if 'locked_ref' is currently NULL, by calling btrfs_select_ref_head(), which can return an error pointer. If the error pointer is -EAGAIN we do a continue and go back to the beginning of the loop, which will not try again to call btrfs_select_ref_head() since 'locked_ref' is no longer NULL but it's ERR_PTR(-EAGAIN), and then we do: spin_lock(&locked_ref->lock); against a ERR_PTR(-EAGAIN) value, generating an invalid pointer dereference. Fix this by ensuring that 'locked_ref' is set to NULL when btrfs_select_ref_head() returns ERR_PTR(-EAGAIN) and incrementing 'count' as well, to prevent infinite looping. We do this by doing a goto to the bottom of the loop that already sets 'locked_ref' to NULL and does a cond_resched(), with an increment to 'count' right before the goto. These measures were in place before the refactoring in commit 0110a4c43451 ("btrfs: refactor __btrfs_run_delayed_refs loop") but were unintentionally lost afterwards.
Title btrfs: fix invalid pointer dereference in __btrfs_run_delayed_refs()
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-08-17T05:45:52.396Z

Reserved: 2026-08-15T05:44:03.884Z

Link: CVE-2026-74321

cve-icon Vulnrichment

No data.

cve-icon NVD

Status : Received

Published: 2026-08-15T06:22:32.600

Modified: 2026-08-17T06:19:26.520

Link: CVE-2026-74321

cve-icon Redhat

Severity : Moderate

Publid Date: 2026-08-15T00:00:00Z

Links: CVE-2026-74321 - Bugzilla

cve-icon OpenCVE Enrichment

Updated: 2026-08-22T00:30:16Z

Weaknesses