CVE-2022-49837: bpf: Fix memory leaks in __check_func_call
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix memory leaks in __check_func_call
kmemleak reports this issue:
unreferenced object 0xffff88817139d000 (size 2048):
comm "test_progs", pid 33246, jiffies 4307381979 (age 45851.820s)
hex dump (first 32 bytes):
01 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:
[<0000000045f075f0>] kmalloc_trace+0x27/0xa0
[<0000000098b7c90a>] __check_func_call+0x316/0x1230
[<00000000b4c3c403>] check_helper_call+0x172e/0x4700
[<00000000aa3875b7>] do_check+0x21d8/0x45e0
[<000000001147357b>] do_check_common+0x767/0xaf0
[<00000000b5a595b4>] bpf_check+0x43e3/0x5bc0
[<0000000011e391b1>] bpf_prog_load+0xf26/0x1940
[<0000000007f765c0>] __sys_bpf+0xd2c/0x3650
[<00000000839815d6>] __x64_sys_bpf+0x75/0xc0
[<00000000946ee250>] do_syscall_64+0x3b/0x90
[<0000000000506b7f>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
The root case here is: In function prepare_func_exit(), the callee is
not released in the abnormal scenario after "state->curframe--;". To
fix, move "state->curframe--;" to the very bottom of the function,
right when we free callee and reset frame[] pointer to NULL, as Andrii
suggested.
In addition, function __check_func_call() has a similar problem. In
the abnormal scenario before "state->curframe++;", the callee also
should be released by free_func_state().
Security readout for executives and security teams
Plain-English summary
This is a Linux kernel eBPF verifier memory leak. A local low-privileged actor could potentially consume kernel memory and affect availability. The sources do not show active exploitation, and the CVE is not listed as KEV.
Executive priority
Handle through normal vulnerability remediation with elevated attention for shared or multi-tenant Linux hosts. The business risk is availability disruption, not data theft, based on current sources.
Technical view
The bug is CWE-401 in Linux kernel BPF function-call checking. Abnormal paths in prepare_func_exit() and __check_func_call() failed to release callee function state, leaking memory during BPF program verification. CVSS is 5.5 with local attack vector, low complexity, low privileges, and high availability impact.
Likely exposure
Exposure is most relevant on Linux systems running affected kernel versions where local users or processes can reach BPF program loading paths. Distro backports may change package-level exposure, so confirm against vendor kernel advisories and the referenced stable commits.
Exploitation context
The provided sources show a local availability issue triggered through BPF verification paths. They do not provide evidence of public exploitation or inclusion in CISA KEV. Treat exploitability details as incomplete beyond the CVSS and kernel fix description.
Researcher notes
The root cause is missed free_func_state() cleanup on abnormal BPF verifier paths around curframe changes. Version metadata is kernel-centric and may not map directly to distro package names; validate using vendor backport information.
Mitigation direction
Update to a vendor kernel containing the referenced stable fixes.
Prioritize systems allowing local BPF program loading by non-administrative users.
Review vendor advisories for distro-specific fixed package versions.
Restrict unnecessary local access on multi-user Linux systems.
Apply standard kernel hardening around BPF access where supported.
Validation and detection
Inventory Linux kernel versions across servers and workloads.
Map installed distro packages to vendor advisories or fixed stable commits.
Check whether local users can access BPF program loading functionality.
Review monitoring for unusual kernel memory pressure or availability events.
Confirm patched systems rebooted into the updated kernel.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cwe · low confidence lookup
CWE-401: Exact CWE lookup
Use the exact CWE identifier as the starting point before reviewing related ATT&CK behavior. Open the exact CWE lookup page first, then review the ATT&CK searches from that MITRE weakness context. This is a Glexia lookup hint, not an official ATT&CK mapping.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.
CWE links open Glexia weakness intelligence pages with official CWE context, developer remediation guidance, and related CVE mappings.
CWE-401 · source CWE mapping
Missing Release of Memory after Effective Lifetime
Missing Release of Memory after Effective Lifetime represents a recurring weakness pattern that can create exploitable paths when design, validation, or implementation controls are missing.