Description
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.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Linux | Linux | 6.11 | 6.12.58 |
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | linux | 6.17.8-1 | — |
| Debian 13 | linux | 6.12.63-1 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 25.10 | linux | 6.17.0-14.14 | USN-8029-1 |
| Ubuntu 25.10 | linux-aws +2 | 6.17.0-1007.7 | USN-8030-1, USN-8029-2 |
| Ubuntu 25.10 | linux-azure +1 | 6.17.0-1008.8 | USN-8029-3, USN-8029-1 |
| Ubuntu 25.10 | linux-azure-fde | No fix yet | — |
| Ubuntu 25.10 | linux-realtime | 6.17.0-1006.7 | USN-8029-1 |
| Ubuntu 25.10 | linux-riscv | 6.17.0-14.14.1 | — |
| Ubuntu 24.04 LTS | linux-aws-6.17 +1 | 6.17.0-1007.7~24.04.1 | — |
| Ubuntu 24.04 LTS | linux-gcp-6.17 | 6.17.0-1008.8~24.04.1 | — |
| Ubuntu 24.04 LTS | linux-nvidia-6.17 | 6.17.0-1008.8 | — |
| Ubuntu 24.04 LTS | linux-oem-6.17 | 6.17.0-1011.11 | USN-8048-1 |
| Ubuntu 24.04 LTS | linux-riscv +18 | No fix yet | — |
| Ubuntu 22.04 LTS | linux-riscv +32 | No fix yet | — |
| Ubuntu 20.04 LTS | linux-gke +28 | No fix yet | — |
| Ubuntu 18.04 LTS | linux-gcp +14 | No fix yet | — |
Show 2 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 16.04 LTS | linux-hwe-edge | No fix yet | — |
| Ubuntu Pro Realtime 24.04 LTS | linux-realtime-6.14 | No fix yet | — |
| Ubuntu Pro Realtime 24.04 LTS | linux-realtime-6.17 | 6.17.0-1006.7~24.04.1 | — |
SUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| SLES for SAP 16.0 | kernel-64kb +8 | 6.12.0-160000.9.1 | SUSE-SU-2026:20220-1 |
| SLES for SAP 16.0 | kernel-default-base | 6.12.0-160000.9.1.160000.2.6 | SUSE-SU-2026:20220-1 |
| SLES 16.0 | kernel-64kb +8 | 6.12.0-160000.9.1 | SUSE-SU-2026:20228-1, SUSE-SU-2026:20220-1 |
| SLES 16.0 | kernel-default-base | 6.12.0-160000.9.1.160000.2.6 | SUSE-SU-2026:20220-1 |
| SLE Micro 6.2 | kernel-default-base | 6.12.0-160000.9.1.160000.2.6 | SUSE-SU-2026:20207-1 |
| SLE Micro 6.2 | kernel-rt +5 | 6.12.0-160000.9.1 | SUSE-SU-2026:20564-1, SUSE-SU-2026:20207-1 |
openSUSE
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| openSUSE Leap 16.0 | kernel-default-base | 6.12.0-160000.9.1.160000.2.6 | openSUSE-SU-2026:20145-1 |
| openSUSE Leap 16.0 | kernel-rt +11 | 6.12.0-160000.9.1 | openSUSE-SU-2026:20145-1 |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | kernel-livepatch-6.12.58-82.121 | 1:1.0-0.amzn2023 | ALAS2023-2026-1495 |
| Amazon Linux 2023 | perf6.12 +14 | 1:6.12.58-82.121.amzn2023 | ALAS2023-2026-1495 |
Oracle Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Oracle Linux 9 | kernel-uek +34 | 6.12.0-107.59.3.2.el10uek | ELSA-2026-50006 |
Advisories 13
- USN-8029-2 linux-aws, linux-oracle vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-8048-1 linux-oem-6.17 vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-8029-3 linux-azure vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-8030-1 linux-gcp vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- USN-8029-1 linux, linux-raspi, linux-realtime vulnerabilities Ubuntu Security Notices (USN) · Nov 3, 2026
- WID-SEC-2025-2658 Linux Kernel: Mehrere Schwachstellen ermöglichen Denial of Service BSI CERT-Bund (WID) · Oct 7, 2026
- SUSE-SU-2026:20564-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Jul 9, 2026
- ALAS2023-2026-1495 Important: kernel6.12 security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Mar 27, 2026
- openSUSE-SU-2026:20145-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2026:20228-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2026:20220-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- SUSE-SU-2026:20207-1 Security update for the Linux Kernel SUSE / openSUSE Security Updates · Mar 23, 2026
- ELSA-2026-50006 Important: Unbreakable Enterprise kernel security update (Oracle Linux 9) Oracle Linux Security Advisories (ELSA) · Jan 13, 2026