# CVE-2022-49878: bpf, verifier: Fix memory leak in array reallocation for stack state

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.28% (percentile 13, 2026-11-26)
- **CWE:** CWE-401
- **Published:** 2025-05-01T14:10:26.389Z
- **Modified:** 2026-06-17T05:19:23.973Z

## Who should check

- Anyone running Linux \>= c69431aab67a912836e5831f03d99a819c14c9c3, \< 06615967d4889b08b19ff3dda96e8b131282f73d; \>= c69431aab67a912836e5831f03d99a819c14c9c3, \< 3e210891c4a4c2d858cd6f9f61d5809af251d4df; \>= c69431aab67a912836e5831f03d99a819c14c9c3, \< 42378a9ca55347102bbf86708776061d8fe3ece2
- Anyone running Linux 5.14

## 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

## Affected and fixed versions

- Linux: \>= c69431aab67a912836e5831f03d99a819c14c9c3, \< 06615967d4889b08b19ff3dda96e8b131282f73d; \>= c69431aab67a912836e5831f03d99a819c14c9c3, \< 3e210891c4a4c2d858cd6f9f61d5809af251d4df; \>= c69431aab67a912836e5831f03d99a819c14c9c3, \< 42378a9ca55347102bbf86708776061d8fe3ece2 (cvelist)
- Linux: 5.14 (cvelist)

## Mitigation

- Upgrade Linux to 42378a9ca55347102bbf86708776061d8fe3ece2 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-49878. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-49878.md
Affected: Linux >= c69431aab67a912836e5831f03d99a819c14c9c3, < 06615967d4889b08b19ff3dda96e8b131282f73d; >= c69431aab67a912836e5831f03d99a819c14c9c3, < 3e210891c4a4c2d858cd6f9f61d5809af251d4df; >= c69431aab67a912836e5831f03d99a819c14c9c3, < 42378a9ca55347102bbf86708776061d8fe3ece2; Linux 5.14
Fixed in: Linux 06615967d4889b08b19ff3dda96e8b131282f73d, Linux 3e210891c4a4c2d858cd6f9f61d5809af251d4df, Linux 42378a9ca55347102bbf86708776061d8fe3ece2

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-49878 being exploited?

There is no confirmed exploitation: CVE-2022-49878 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.28% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-49878?

Medium: CVSS 5.5 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-49878?

Linux \>= c69431aab67a912836e5831f03d99a819c14c9c3, \< 06615967d4889b08b19ff3dda96e8b131282f73d; \>= c69431aab67a912836e5831f03d99a819c14c9c3, \< 3e210891c4a4c2d858cd6f9f61d5809af251d4df; \>= c69431aab67a912836e5831f03d99a819c14c9c3, \< 42378a9ca55347102bbf86708776061d8fe3ece2; Linux 5.14.

### Is there a fix for CVE-2022-49878?

Yes. Fixed in Linux 06615967d4889b08b19ff3dda96e8b131282f73d, Linux 3e210891c4a4c2d858cd6f9f61d5809af251d4df, Linux 42378a9ca55347102bbf86708776061d8fe3ece2. Upgrade Linux to 42378a9ca55347102bbf86708776061d8fe3ece2 or later.

### How do I check if I'm affected by CVE-2022-49878?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/06615967d4889b08b19ff3dda96e8b131282f73d>
- patch: <https://git.kernel.org/stable/c/3e210891c4a4c2d858cd6f9f61d5809af251d4df>
- patch: <https://git.kernel.org/stable/c/42378a9ca55347102bbf86708776061d8fe3ece2>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-49878>

HTML: <https://flawdb.com/CVE-2022-49878> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-49878>
