CVE-2025-40101

btrfs: fix memory leaks when rejecting a non SINGLE data profile without an RST

No CVSS score yet EPSS 0.20%

Published 30 Oct 2025 Updated 23 May 2026 CNA: Linux

Check your servers for CVE-2025-40101

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2025-40101 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

Description

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

btrfs: fix memory leaks when rejecting a non SINGLE data profile without an RST

At the end of btrfs_load_block_group_zone_info() the first thing we do is to ensure that if the mapping type is not a SINGLE one and there is no RAID stripe tree, then we return early with an error.

Doing that, though, prevents the code from running the last calls from this function which are about freeing memory allocated during its run. Hence, in this case, instead of returning early, we set the ret value and fall through the rest of the cleanup code.

Exploitation

EPSS 0.20%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 9.88% of all scored CVEs. Scores of 1 Dec 2026.

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from 5906333cc4af7b3fdb8cfff1cb3e8e579bd13174, before 187333e6d484c6630286bfdd07c79d6815a63887
affected from 5906333cc4af7b3fdb8cfff1cb3e8e579bd13174, before 602701d00439e113331ee9c1283e95afdcb8849d
affected from 5906333cc4af7b3fdb8cfff1cb3e8e579bd13174, before fec9b9d3ced39f16be8d7afdf81f4dd2653da319
affected 6ffeca99bf6e84800133d21afd41c79d2f002db7
affected from 6.7.11, before 6.8
Other versions: unaffected
Linux
affected 6.8
unaffected before 6.8
unaffected from 6.12.55 up to and including 6.12.*
unaffected from 6.17.5 up to and including 6.17.*
unaffected 6.18 and later
Other versions: affected

Is my server affected?

This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:

uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2025-40101 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2025-40101

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2025-40101
trivy image --scanners vuln IMAGE | grep CVE-2025-40101

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2025-40101 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.