CVE-2022-49878: bpf, verifier: Fix memory leak in array reallocation for stack state
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
Security readout for executives and security teams
Plain-English summary
CVE-2022-49878 is a Linux kernel BPF verifier memory leak. A local low-privileged user could trigger failed stack-state reallocation and consume kernel memory, affecting availability. The source bundle does not show data theft, integrity impact, or confirmed active exploitation.
Executive priority
Schedule remediation through normal kernel patching, with higher priority for shared or multi-tenant Linux systems. This is not evidenced as internet-routed or actively exploited in the provided sources, but availability impact can matter on critical hosts.
Technical view
The bug is a CWE-401 leak in BPF verifier stack-state array reallocation. On krealloc() failure, callers replaced allocation pointers with NULL while the original allocation remained live. The fix frees the old allocation on the error path. CVSS is 5.5 with local, low-privilege availability impact.
Likely exposure
Likely exposure is Linux systems running affected kernel versions where local users or workloads can load BPF programs. Multi-user servers, developer systems, and shared compute hosts deserve more attention. Exact distro package exposure must be confirmed through vendor kernel advisories.
Exploitation context
The bundle marks KEV as false and provides no cited evidence of active exploitation. The attack context is local and low privilege, with no user interaction. Impact is availability through memory resource exhaustion, not confidentiality or integrity.
Researcher notes
Focus validation on the BPF verifier path around realloc_array(), grow_stack_state(), and check_mem_access(). The source evidence is a kernel memory leak on allocation failure, with stable commits referenced but no exploit proof or distro-specific fix matrix in the bundle.
Mitigation direction
Apply vendor kernel updates that include the referenced stable Linux fixes.
Check Linux distribution advisories for exact fixed package versions.
Prioritize multi-user and shared workload hosts first.
Limit unnecessary BPF access for untrusted local users where policy supports it.
Monitor affected hosts for unusual kernel memory pressure until patched.
Validation and detection
Inventory Linux kernel versions across servers and workstations.
Map kernel packages to vendor advisories for CVE-2022-49878.
Confirm whether local users or workloads can load BPF programs.
Review changelogs for the referenced stable commit identifiers.
Verify patched kernels are running after maintenance reboots.
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.