Skip to main content

CVE-2025-37807: Vulnerability in Linux Linux

Low
VulnerabilityCVE-2025-37807cvecve-2025-37807
Published: Thu May 08 2025 (05/08/2025, 06:26:06 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

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.

AI-Powered Analysis

AILast updated: 07/03/2025, 23:39:52 UTC

Technical Analysis

CVE-2025-37807 is a vulnerability identified in the Linux kernel related to the Berkeley Packet Filter (BPF) subsystem, specifically involving the handling of per-CPU hashmaps. The issue arises from improper memory alignment when storing a per-CPU pointer (pptr) within the hash table elements (htab_elem). The Linux kernel's memory leak detection tool, kmemleak, reported unreferenced objects due to this misalignment. The root cause is that the pptr is stored at a 4-byte aligned address instead of the required 8-byte alignment on x86_64 architectures. This misalignment causes kmemleak's scanning mechanism, which operates on an 8-byte stride, to miss these pointers, falsely reporting memory leaks. The vulnerability does not directly cause a memory leak or corruption but leads to false positives in kmemleak reports, potentially obscuring real memory issues. The problem is reproducible using the BPF selftests with kmemleak enabled. The fix involves ensuring that the pptr is stored with proper 8-byte alignment by adjusting the element size calculations in the hash table allocation code. This correction aligns the data structures properly, eliminating the false memory leak reports and improving kernel memory diagnostics accuracy. No known exploits are reported in the wild, and the vulnerability primarily affects kernel debugging and memory leak detection reliability rather than system security or stability directly.

Potential Impact

For European organizations, the direct security impact of CVE-2025-37807 is minimal since it does not lead to privilege escalation, data corruption, or denial of service. However, the vulnerability affects the reliability of the Linux kernel's memory leak detection mechanism (kmemleak). Organizations relying on kmemleak for kernel debugging, especially those developing or maintaining custom kernel modules or BPF programs, may experience false positives that could obscure genuine memory leaks. This can lead to increased troubleshooting time, misdiagnosis of kernel memory issues, and potentially delayed detection of critical bugs. In environments where kernel stability and reliability are paramount—such as telecommunications, financial services, and critical infrastructure—this could indirectly affect operational efficiency. Since Linux is widely used across European enterprises, cloud providers, and embedded systems, ensuring accurate kernel diagnostics is important for maintaining system integrity and performance. The vulnerability does not pose a direct threat to confidentiality, integrity, or availability but impacts the quality of kernel debugging and maintenance processes.

Mitigation Recommendations

To mitigate the effects of CVE-2025-37807, European organizations should: 1) Apply the official Linux kernel patch that corrects the alignment of per-CPU pointers in the BPF hashmap implementation. This patch ensures proper 8-byte alignment and resolves the kmemleak false positives. 2) Enable CONFIG_DEBUG_KMEMLEAK only in development or testing environments where kernel memory diagnostics are needed, avoiding unnecessary overhead in production. 3) Review and update internal kernel debugging and testing procedures to incorporate the patched kernel versions, ensuring that memory leak reports are accurate. 4) For organizations developing BPF programs or custom kernel modules, validate their code against the patched kernel to prevent misinterpretation of kmemleak outputs. 5) Monitor Linux kernel mailing lists and security advisories for any updates or related issues to maintain up-to-date kernel security and stability. 6) Consider integrating additional kernel debugging tools that complement kmemleak to cross-verify memory issues, reducing reliance on a single diagnostic method.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-04-16T04:51:23.942Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9819c4522896dcbd87d3

Added to database: 5/21/2025, 9:08:41 AM

Last enriched: 7/3/2025, 11:39:52 PM

Last updated: 8/8/2025, 12:50:38 PM

Views: 17

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats