Skip to main content

CVE-2022-49878: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2022-49878cvecve-2022-49878
Published: Thu May 01 2025 (05/01/2025, 14:10:26 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: bpf, verifier: Fix memory leak in array reallocation for stack state If an error (NULL) is returned by krealloc(), callers of realloc_array() were setting their allocation pointers to NULL, but on error krealloc() does not touch the original allocation. This would result in a memory resource leak. Instead, free the old allocation on the error handling path. The memory leak information is as follows as also reported by Zhengchao: unreferenced object 0xffff888019801800 (size 256): comm "bpf_repo", pid 6490, jiffies 4294959200 (age 17.170s) hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<00000000b211474b>] __kmalloc_node_track_caller+0x45/0xc0 [<0000000086712a0b>] krealloc+0x83/0xd0 [<00000000139aab02>] realloc_array+0x82/0xe2 [<00000000b1ca41d1>] grow_stack_state+0xfb/0x186 [<00000000cd6f36d2>] check_mem_access.cold+0x141/0x1341 [<0000000081780455>] do_check_common+0x5358/0xb350 [<0000000015f6b091>] bpf_check.cold+0xc3/0x29d [<000000002973c690>] bpf_prog_load+0x13db/0x2240 [<00000000028d1644>] __sys_bpf+0x1605/0x4ce0 [<00000000053f29bd>] __x64_sys_bpf+0x75/0xb0 [<0000000056fedaf5>] do_syscall_64+0x35/0x80 [<000000002bd58261>] entry_SYSCALL_64_after_hwframe+0x63/0xcd

AI-Powered Analysis

AILast updated: 06/30/2025, 02:56:02 UTC

Technical Analysis

CVE-2022-49878 is a vulnerability identified in the Linux kernel's BPF (Berkeley Packet Filter) verifier component. The issue arises from improper handling of memory allocation failures during array reallocation for stack state management. Specifically, when the kernel function krealloc() returns NULL due to an allocation failure, the callers of realloc_array() incorrectly set their allocation pointers to NULL without freeing the original memory allocation. Since krealloc() does not free the original memory on failure, this behavior leads to a memory leak. The vulnerability was discovered in the context of BPF program verification, where the stack state array is dynamically resized. The memory leak can cause unreferenced kernel memory objects to accumulate, potentially degrading system performance or leading to resource exhaustion over time. The technical details include a backtrace showing the call chain from __kmalloc_node_track_caller through krealloc, realloc_array, grow_stack_state, and ultimately to the BPF program loading syscall. This flaw does not appear to allow direct code execution or privilege escalation but can impact system stability and availability by leaking kernel memory resources. No known exploits are reported in the wild, and no CVSS score has been assigned yet. The vulnerability affects specific Linux kernel versions identified by commit hashes, and a patch is implied but not linked in the provided data.

Potential Impact

For European organizations running Linux-based systems, especially those utilizing BPF for network monitoring, security, or performance analysis, this vulnerability poses a risk of gradual kernel memory resource leakage. Over time, this can lead to system instability, degraded performance, or even denial of service due to exhaustion of kernel memory pools. Critical infrastructure, cloud service providers, and enterprises relying on Linux servers for networking or container orchestration could experience service disruptions if the vulnerability is exploited or triggered inadvertently. Although the vulnerability does not directly enable remote code execution or privilege escalation, the resulting memory leak could be leveraged as part of a broader attack chain or cause operational impacts that affect availability. Organizations with high uptime requirements or those operating in regulated sectors must consider the risk of system degradation and potential downtime. The absence of known exploits reduces immediate risk, but the vulnerability should be addressed proactively to maintain system integrity and reliability.

Mitigation Recommendations

European organizations should prioritize updating their Linux kernel to the patched versions that address CVE-2022-49878 as soon as they become available. In the interim, monitoring kernel memory usage and BPF verifier activity can help detect abnormal memory consumption patterns indicative of the leak. Restricting untrusted users from loading or verifying BPF programs can reduce the attack surface, as the vulnerability is triggered during BPF program verification. Employing kernel hardening and resource limits (e.g., cgroups) to constrain memory usage by kernel subsystems may mitigate the impact of leaks. Additionally, organizations should integrate this vulnerability into their patch management and vulnerability scanning workflows to ensure timely remediation. Testing kernel updates in staging environments before deployment is recommended to avoid unintended disruptions. Finally, maintaining comprehensive logging and alerting on kernel errors or resource exhaustion events will aid in early detection and response.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-05-01T14:05:17.239Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982cc4522896dcbe4f08

Added to database: 5/21/2025, 9:09:00 AM

Last enriched: 6/30/2025, 2:56:02 AM

Last updated: 7/28/2025, 8:57:44 AM

Views: 10

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