CVE-2025-40209
Linux Debian vulnerability analysis and mitigation

Overview

A memory leak vulnerability was discovered in the Linux kernel's BTRFS filesystem component, identified as CVE-2025-40209. The issue was disclosed on November 21, 2025, affecting the btrfsaddqgroup_relation function when handling invalid qgroup levels (NVD).

Technical details

The vulnerability occurs in the btrfsaddqgrouprelation() function when called with invalid qgroup levels (src >= dst). The function returns -EINVAL directly without freeing the preallocated qgrouplist structure passed by the caller. This happens because the level validation check occurs before the mutex acquisition and before any error handling path that would free the prealloc pointer. The cleanup code at the 'out' label is never reached, resulting in a 64-byte memory leak per failed operation (NVD, Debian Tracker).

Impact

The vulnerability can be triggered repeatedly by an unprivileged user with access to a writable btrfs mount, potentially leading to kernel memory exhaustion. Each failed operation results in a 64-byte memory leak (NVD).

Mitigation and workarounds

The fix involves ensuring prealloc is freed before the early return, guaranteeing that prealloc is always freed on all error paths. This prevents the memory leak condition from occurring (NVD).

Additional resources


SourceThis report was generated using AI

Related Linux Debian vulnerabilities:

CVE ID

Severity

Score

Technologies

Component name

CISA KEV exploit

Has fix

Published date

CVE-2025-13470HIGH7.7
  • Linux DebianLinux Debian
  • rnp
NoYesNov 21, 2025
CVE-2025-62626HIGH7.2
  • EchoEcho
  • libertas-sd8686-firmware
NoYesNov 21, 2025
CVE-2025-40211N/AN/A
  • Linux KernelLinux Kernel
  • kernel-rt-64k-modules-internal
NoYesNov 21, 2025
CVE-2025-40210N/AN/A
  • EchoEcho
  • linux
NoYesNov 21, 2025
CVE-2025-40209N/AN/A
  • Linux DebianLinux Debian
  • linux
NoYesNov 21, 2025

Free Vulnerability Assessment

Benchmark your Cloud Security Posture

Evaluate your cloud security practices across 9 security domains to benchmark your risk level and identify gaps in your defenses.

Request assessment

Get a personalized demo

Ready to see Wiz in action?

"Best User Experience I have ever seen, provides full visibility to cloud workloads."
David EstlickCISO
"Wiz provides a single pane of glass to see what is going on in our cloud environments."
Adam FletcherChief Security Officer
"We know that if Wiz identifies something as critical, it actually is."
Greg PoniatowskiHead of Threat and Vulnerability Management