Description
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix kmemleak warning for percpu hashmap
Vlad Poenaru reported the following kmemleak issue:
unreferenced object 0x606fd7c44ac8 (size 32):
backtrace (crc 0):
pcpu_alloc_noprof+0x730/0xeb0
bpf_map_alloc_percpu+0x69/0xc0
prealloc_init+0x9d/0x1b0
htab_map_alloc+0x363/0x510
map_create+0x215/0x3a0
__sys_bpf+0x16b/0x3e0
__x64_sys_bpf+0x18/0x20
do_syscall_64+0x7b/0x150
entry_SYSCALL_64_after_hwframe+0x4b/0x53
Further investigation shows the reason is due to not 8-byte aligned
store of percpu pointer in htab_elem_set_ptr():
*(void __percpu **)(l->key + key_size) = pptr;
Note that the whole htab_elem alignment is 8 (for x86_64). If the key_size
is 4, that means pptr is stored in a location which is 4 byte aligned but
not 8 byte aligned. In mm/kmemleak.c, scan_block() scans the memory based
on 8 byte stride, so it won't detect above pptr, hence reporting the memory
leak.
In htab_map_alloc(), we already have
htab->elem_size = sizeof(struct htab_elem) +
round_up(htab->map.key_size, 8);
if (percpu)
htab->elem_size += sizeof(void *);
else
htab->elem_size += round_up(htab->map.value_size, 8);
So storing pptr with 8-byte alignment won't cause any problem and can fix
kmemleak too.
The issue can be reproduced with bpf selftest as well:
1. Enable CONFIG_DEBUG_KMEMLEAK config
2. Add a getchar() before skel destroy in test_hash_map() in prog_tests/for_each.c.
The purpose is to keep map available so kmemleak can be detected.
3. run './test_progs -t for_each/hash_map &' and a kmemleak should be reported.
Affected products
| Vendor | Product | Affected | Fixed |
|---|---|---|---|
| Linux | Linux | 4.6 | 6.1.191 |
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.12.27-1 | — |
| Debian 13 | linux | 6.12.27-1 | — |
| Debian 12 | linux | No fix yet | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu Nvidia-BlueField 24.04 LTS | linux-bluefield | 6.8.0-1036.41 | — |
| Ubuntu Nvidia-BlueField 22.04 LTS | linux-bluefield | No fix yet | — |
| Ubuntu 25.10 | linux-azure-fde | No fix yet | — |
| Ubuntu 25.04 | linux | 6.14.0-22.22 | USN-7594-1 |
| Ubuntu 25.04 | linux-aws +3 | 6.14.0-1007.7 | USN-7594-3, USN-7594-2, USN-7594-1 |
| Ubuntu 25.04 | linux-gcp | 6.14.0-1008.8 | USN-7594-1 |
| Ubuntu 25.04 | linux-realtime | 6.14.0-1004.4 | USN-7594-1 |
| Ubuntu 24.04 LTS | linux | 6.8.0-149.149 | USN-9022-1 |
| Ubuntu 24.04 LTS | linux-aws | 6.8.0-1069.74 | USN-9022-1 |
| Ubuntu 24.04 LTS | linux-azure | 6.8.0-1073.82 | USN-9022-1 |
| Ubuntu 24.04 LTS | linux-azure-fde | 6.8.0-1071.78 | USN-9039-1 |
| Ubuntu 24.04 LTS | linux-gcp | 6.8.0-1073.81 | USN-9022-1 |
| Ubuntu 24.04 LTS | linux-gcp-6.14 | 6.14.0-1011.11~24.04.1 | — |
| Ubuntu 24.04 LTS | linux-gke | 6.8.0-1068.77 | USN-9022-1 |
| Ubuntu 24.04 LTS | linux-gkeop | 6.8.0-1053.57 | USN-9023-1 |
| Ubuntu 24.04 LTS | linux-ibm | 6.8.0-1069.70 | USN-9022-1 |
| Ubuntu 24.04 LTS | linux-intel +13 | No fix yet | — |
| Ubuntu 24.04 LTS | linux-lowlatency | 6.8.0-149.149.1 | USN-9022-1 |
| Ubuntu 24.04 LTS | linux-nvidia | 6.8.0-1067.70 | USN-9024-1 |
| Ubuntu 24.04 LTS | linux-nvidia-lowlatency | 6.8.0-1067.70.1 | USN-9040-1 |
| Ubuntu 24.04 LTS | linux-nvidia-tegra | 6.8.0-1036.39 | USN-8886-1 |
| Ubuntu 24.04 LTS | linux-oracle | 6.8.0-1067.71 | USN-9022-1 |
| Ubuntu 24.04 LTS | linux-raspi | 6.8.0-1068.72 | USN-9025-1 |
| Ubuntu 24.04 LTS | linux-vmware | 6.8.0-1010.10 | USN-9022-1 |
Show 17 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 22.04 LTS | linux +50 | No fix yet | — |
| Ubuntu 22.04 LTS | linux-aws-6.8 | 6.8.0-1069.74~22.04.1 | USN-9024-1 |
| Ubuntu 22.04 LTS | linux-azure-6.8 | 6.8.0-1073.82~22.04.1 | USN-9026-1 |
| Ubuntu 22.04 LTS | linux-azure-fde-6.8 | 6.8.0-1071.78~22.04.1 | USN-9026-1 |
| Ubuntu 22.04 LTS | linux-gcp-6.8 | 6.8.0-1073.81~22.04.1 | USN-9024-1 |
| Ubuntu 22.04 LTS | linux-hwe-6.8 | 6.8.0-149.149~22.04.1 | USN-9066-1 |
| Ubuntu 22.04 LTS | linux-ibm-6.8 | 6.8.0-1069.70~22.04.1 | USN-9024-1 |
| Ubuntu 22.04 LTS | linux-lowlatency-hwe-6.8 | 6.8.0-149.149.1~22.04.1 | USN-9024-1 |
| Ubuntu 22.04 LTS | linux-oracle-6.8 | 6.8.0-1067.71~22.04.1 | USN-9025-1 |
| Ubuntu 20.04 LTS | linux-gke +28 | No fix yet | — |
| Ubuntu 18.04 LTS | linux-gcp +14 | No fix yet | — |
| Ubuntu 16.04 LTS | linux-hwe-edge | No fix yet | — |
| Ubuntu Pro Realtime 24.04 LTS | linux-raspi-realtime | 6.8.0-2056.58 | USN-9025-1 |
| Ubuntu Pro Realtime 24.04 LTS | linux-realtime | 6.8.1-1064.65 | USN-9023-1 |
| Ubuntu Pro Realtime 24.04 LTS | linux-realtime-6.14 | 6.14.0-1010.10~24.04.1 | — |
| Ubuntu Pro Realtime 22.04 LTS | linux-realtime +1 | No fix yet | — |
| Ubuntu Pro Realtime 22.04 LTS | linux-realtime-6.8 | 6.8.1-1064.65~22.04.1 | USN-9024-1 |
| Ubuntu Pro FIPS 20.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro FIPS 18.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro FIPS-updates 24.04 LTS | linux-aws-fips | 6.8.0-1069.74+fips1 | USN-9023-1 |
| Ubuntu Pro FIPS-updates 24.04 LTS | linux-azure-fips | 6.8.0-1073.82+fips1 | USN-9022-1 |
| Ubuntu Pro FIPS-updates 24.04 LTS | linux-fips | No fix yet | — |
| Ubuntu Pro FIPS-updates 24.04 LTS | linux-gcp-fips | 6.8.0-1073.81+fips1 | USN-9023-1 |
| Ubuntu Pro FIPS-updates 22.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro FIPS-updates 20.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro FIPS-updates 18.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro FIPS-preview 22.04 LTS | linux-fips +3 | No fix yet | — |
| Ubuntu Pro 20.04 LTS | linux +21 | No fix yet | — |
| Ubuntu Pro 18.04 LTS | linux +12 | No fix yet | — |
| Ubuntu Pro 16.04 LTS | linux-gcp +4 | No fix yet | — |
| Ubuntu Pro 14.04 LTS | linux-azure | No fix yet | — |
Amazon Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Amazon Linux 2023 | bpftool +14 | 6.12.29-33.102.amzn2023 | ALAS2023-2025-1111, ALAS2023-2025-994 |
| Amazon Linux 2023 | kernel-livepatch-6.1.144-170.251 | 1:1.0-0.amzn2023 | ALAS2023-2025-1111 |
| Amazon Linux 2023 | kernel-livepatch-6.12.29-33.102 | 1.0-0.amzn2023 | ALAS2023-2025-994 |
| Amazon Linux 2023 | perf +5 | 1:6.1.144-170.251.amzn2023 | ALAS2023-2025-1111 |
Azure Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Azure Linux 3 | kernel | No fix yet | — |
| Azure Linux 2 (CBL-Mariner) | kernel | No fix yet | — |
Oracle Linux
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Oracle Linux 9 | kernel-uek +34 | 6.12.0-101.33.4.3.el10uek | ELSA-2025-20530, ELSA-2025-20480 |
Advisories 17
- USN-9066-1 linux-hwe-6.8 vulnerabilities Ubuntu Security Notices (USN) · Nov 12, 2026
- USN-9022-1 linux, linux-aws, linux-azure, linux-azure-fips, linux-gcp, linux-gke, linux-ibm, linux-lowlatency, linux-oracle, linux-vmware vulnerabilities Ubuntu Security Notices (USN) · Nov 12, 2026
- USN-9024-1 linux-aws-6.8, linux-gcp-6.8, linux-ibm-6.8, linux-lowlatency-hwe-6.8, linux-nvidia, linux-realtime-6.8 vulnerabilities Ubuntu Security Notices (USN) · Nov 12, 2026
- USN-9026-1 linux-azure-6.8, linux-azure-fde-6.8 vulnerabilities Ubuntu Security Notices (USN) · Nov 12, 2026
- USN-9039-1 linux-azure-fde vulnerabilities Ubuntu Security Notices (USN) · Nov 12, 2026
- WID-SEC-2025-0975 Linux Kernel: Mehrere Schwachstellen ermöglichen Denial of Service BSI CERT-Bund (WID) · Nov 12, 2026
- USN-9040-1 linux-nvidia-lowlatency vulnerabilities Ubuntu Security Notices (USN) · Nov 12, 2026
- USN-9025-1 linux-oracle-6.8, linux-raspi, linux-raspi-realtime vulnerabilities Ubuntu Security Notices (USN) · Nov 12, 2026
- USN-9023-1 linux-aws-fips, linux-gcp-fips, linux-gkeop, linux-realtime vulnerabilities Ubuntu Security Notices (USN) · Nov 12, 2026
- USN-8886-1 linux-nvidia-tegra vulnerabilities Ubuntu Security Notices (USN) · Nov 12, 2026
- USN-7594-2 linux-azure vulnerabilities Ubuntu Security Notices (USN) · Feb 4, 2026
- USN-7594-1 linux, linux-gcp, linux-raspi, linux-realtime vulnerabilities Ubuntu Security Notices (USN) · Feb 4, 2026
- USN-7594-3 linux-aws, linux-oracle vulnerabilities Ubuntu Security Notices (USN) · Feb 4, 2026
- ALAS2023-2025-1111 Important: kernel security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Oct 2, 2025
- ALAS2023-2025-994 Important: kernel6.12 security update (Amazon Linux 2023) Amazon Linux Security Center (ALAS) · Aug 26, 2025
- ELSA-2025-20530 Important: Unbreakable Enterprise kernel security update (Oracle Linux 9) Oracle Linux Security Advisories (ELSA) · Aug 18, 2025
- ELSA-2025-20480 Important: Unbreakable Enterprise kernel security update (Oracle Linux 9) Oracle Linux Security Advisories (ELSA) · Jul 17, 2025
References
- https://git.kernel.org/stable/c/c5f4b04e1838b9eec426d80500af49cff8631762
- https://git.kernel.org/stable/c/25014e3dfa6d2fb95c920b9e6b2f0b303baa4533
- https://git.kernel.org/stable/c/7758e308aeda1038aba1944f7302d34161b3effe
- https://git.kernel.org/stable/c/1f1c29aa1934177349c17e3c32e68ec38a7a56df
- https://git.kernel.org/stable/c/11ba7ce076e5903e7bdc1fd1498979c331b3c286