In the Linux kernel, the following vulnerability has been resolved:
btrfs: fix memory leak of qgroup_list in btrfs_add_qgroup_relation
When btrfs_add_qgroup_relation() is called with invalid qgroup levels (src >= dst), the function returns -EINVAL directly without freeing the preallocated qgroup_list structure passed by the caller. This causes a memory leak because the caller unconditionally sets the pointer to NULL after the call, preventing any cleanup.
The issue occurs because the level validation check happens before the mutex is acquired and before any error handling path that would free the prealloc pointer. On this early return, the cleanup code at the 'out' label (which includes kfree(prealloc)) is never reached.
In btrfs_ioctl_qgroup_assign(), the code pattern is:
prealloc = kzalloc(sizeof(*prealloc), GFP_KERNEL); ret = btrfs_add_qgroup_relation(trans, sa->src, sa->dst, prealloc); prealloc = NULL; // Always set to NULL regardless of return value ... kfree(prealloc); // This becomes kfree(NULL), does nothing
When the level check fails, 'prealloc' is never freed by either the callee or the caller, resulting in a 64-byte memory leak per failed operation. This can be triggered repeatedly by an unprivileged user with access to a writable btrfs mount, potentially exhausting kernel memory.
Fix this by freeing prealloc before the early return, ensuring prealloc is always freed on all error paths.
Covered by Rapid7
| Product | Vendor Advisory | Solution File | Added | Published |
|---|---|---|---|---|
| Debian | — | Upgrade linux | Jul 23, 2026 | Jul 23, 2026 |
| Ubuntu | — | Upgrade linux-image-6.17.0-1007-oracleUpgrade linux-image-6.17.0-1011-oemUpgrade linux-image-virtual-6.17Upgrade linux-image-gcpUpgrade linux-image-raspi-6.17Upgrade linux-image-oracle-64kUpgrade linux-image-aws-6.17Upgrade linux-image-realtimeUpgrade linux-image-6.17.0-14-generic-64kUpgrade linux-image-6.17.0-1006-realtimeUpgrade linux-image-6.17.0-1008-azureUpgrade linux-image-oracleUpgrade linux-image-awsUpgrade linux-image-generic-6.17Upgrade linux-image-aws-64kUpgrade linux-image-gcp-6.17Upgrade linux-image-6.17.0-1007-aws-64kUpgrade linux-image-virtualUpgrade linux-image-gcp-64kUpgrade linux-image-generic-64kUpgrade linux-image-azureUpgrade linux-image-gcp-64k-6.17Upgrade linux-image-6.17.0-1007-gcp-64kUpgrade linux-image-genericUpgrade linux-image-realtime-6.17Upgrade linux-image-raspiUpgrade linux-image-oem-6.17Upgrade linux-image-6.17.0-1007-gcpUpgrade linux-image-generic-64k-6.17Upgrade linux-image-oracle-64k-6.17Upgrade linux-image-6.17.0-1007-awsUpgrade linux-image-aws-64k-6.17Upgrade linux-image-oracle-6.17Upgrade linux-image-azure-6.17Upgrade linux-image-6.17.0-14-genericUpgrade linux-image-6.17.0-1008-raspiUpgrade linux-image-6.17.0-1007-oracle-64k | Feb 13, 2026 | Feb 12, 2026 |
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