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.
CVSS Details
- CVSS 3.1 Base Score: 9.8
- CVSS 3.1 Vector: (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H)
Covered by Rapid7
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Redhat_linux | — | No solution exists | Jul 17, 2026 | Dec 24, 2025 |
| Ubuntu | — | Upgrade linux-image-raspi-6.17Upgrade linux-image-azure-6.17Upgrade linux-image-virtual-hwe-24.04Upgrade linux-image-oem-24.04Upgrade linux-image-genericUpgrade linux-image-aws-6.17Upgrade linux-image-gcpUpgrade linux-image-oem-24.04aUpgrade linux-image-realtime-hwe-24.04Upgrade linux-image-oem-24.04dUpgrade linux-image-raspiUpgrade linux-image-generic-64k-6.17Upgrade linux-image-oracle-64kUpgrade linux-image-6.17.0-1010-azureUpgrade linux-image-azureUpgrade linux-image-virtual-6.17Upgrade linux-image-aws-64kUpgrade linux-image-aws-64k-6.17Upgrade linux-image-generic-6.17Upgrade linux-image-generic-64kUpgrade linux-image-generic-hwe-24.04Upgrade linux-image-6.17.0-1009-awsUpgrade linux-image-6.17.0-1009-oracleUpgrade linux-image-realtime-6.17Upgrade linux-image-gcp-64kUpgrade linux-image-generic-64k-hwe-24.04Upgrade linux-image-oracle-6.17Upgrade linux-image-oem-24.04cUpgrade linux-image-6.17.0-19-genericUpgrade linux-image-gcp-6.17Upgrade linux-image-oem-6.17Upgrade linux-image-realtimeUpgrade linux-image-6.17.0-19-generic-64kUpgrade linux-image-virtualUpgrade linux-image-oem-24.04bUpgrade linux-image-gcp-64k-6.17Upgrade linux-image-6.17.0-1008-realtimeUpgrade linux-image-6.17.0-1017-oemUpgrade linux-image-6.17.0-1009-gcpUpgrade linux-image-6.17.0-1010-raspiUpgrade linux-image-awsUpgrade linux-image-6.17.0-1009-oracle-64kUpgrade linux-image-6.17.0-1009-aws-64kUpgrade linux-image-6.17.0-1009-gcp-64kUpgrade linux-image-oracleUpgrade linux-image-oracle-64k-6.17 | Mar 17, 2026 | Dec 24, 2025 |
| Vmware Photon_os | — | Use 'tdnf update' to upgrade all packages to the latest version. | Jul 24, 2026 | Dec 24, 2025 |
Prioritise with Active Threat Intelligence
With curated Threat Intelligence, you can see which vulnerabilities truly put you at risk, prioritize what matters most, and act before attackers do.
Explore Intelligence Hub