VDB

CVE-2025-68359

CVE-2025-68359 PUBLISHED CVSS 9.8 CRITICAL

btrfs: fix double free of qgroup record after failure to add delayed ref head

Reported by linux · Published December 24, 2025

In the Linux kernel, the following vulnerability has been resolved: btrfs: fix double free of qgroup record after failure to add delayed ref head In the previous code it was possible to incur into a double kfree() scenario when calling add_delayed_ref_head(). This could happen if the record was reported to already exist in the btrfs_qgroup_trace_extent_nolock() call, but then there was an error later on add_delayed_ref_head(). In this case, since add_delayed_ref_head() returned an error, the caller went to free the record. Since add_delayed_ref_head() couldn't set this kfree'd pointer to NULL, then kfree() would have acted on a non-NULL 'record' object which was pointing to memory already freed by the callee. The problem comes from the fact that the responsibility to kfree the object is on both the caller and the callee at the same time. Hence, the fix for this is to shift the ownership of the 'qrecord' object out of the add_delayed_ref_head(). That is, we will never attempt to kfree() the given object inside of this function, and will expect the caller to act on the 'qrecord' object on its own. The only exception where the 'qrecord' object cannot be kfree'd is if it was inserted into the tracing logic, for which we already have the 'qrecord_inserted_ret' boolean to account for this. Hence, the caller has to kfree the object only if add_delayed_ref_head() reports not to have inserted it on the tracing logic. As a side-effect of the above, we must guarantee that 'qrecord_inserted_ret' is properly initialized at the start of the function, not at the end, and then set when an actual insert happens. This way we avoid 'qrecord_inserted_ret' having an invalid value on an early exit. The documentation from the add_delayed_ref_head() has also been updated to reflect on the exact ownership of the 'qrecord' object.

EPSS 0.63% · 50.9th percentile

Fixed versions

Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.

PackageEcosystemFixed in
linux_kernellinux6.19, 6.18.2, 6.17.13

Risk scores

CVSS 3.1
9.8
CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H
EPSS Score
0.63%
50.9th percentile

Affected products

VendorProductVersions
LinuxLinux6ef8fbce010421bf742b12b8f8f2b2d2ff154845, 6ef8fbce010421bf742b12b8f8f2b2d2ff154845, 6ef8fbce010421bf742b12b8f8f2b2d2ff154845
LinuxLinux6.12, 0, 6.12.114
linuxlinux_kernel6.12, 6.12, 6.12
LinuxLinux6ef8fbce010421bf742b12b8f8f2b2d2ff154845, 6.12, 6.17.13

Timeline

  • Dec 23, 2025 CVE Published
  • Dec 24, 2025 EPSS Score (30 in total, the first dated here)
  • Mar 26, 2026 Coalition ESS Score (2 in total, the first dated here)
  • Mar 29, 2026 Distribution Patch (130 in total, the first dated here)
  • Mar 29, 2026 Security Advisory (135 in total, the first dated here)
  • Jul 30, 2026 CVE Updated

Query this with the API

The same record, from the CLI:

vulnetix vdb vuln CVE-2025-68359
vulnetix vdb fixes CVE-2025-68359

Or with curl, using the org id and key from your account page:

curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
  "https://api.vdb.vulnetix.com/v2/vuln/CVE-2025-68359/fixes/registry"

The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart

References

Look up in the Resolve Platform →
$ Lookup Community · 50/day Open Lookup ›