# CVE-2022-49891: tracing: kprobe: Fix memory leak in test\_gen\_kprobe/kretprobe\_cmd()

> 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:35.115Z
- **Modified:** 2026-06-17T05:19:26.240Z

## Who should check

- Anyone running Linux \>= 64836248dda20c8e7427b493f7e06d9bf8f58850, \< bef08acbe560a926b4cee9cc46404cc98ae5703b; \>= 64836248dda20c8e7427b493f7e06d9bf8f58850, \< d1b6a8e3414aeaa0985139180c145d2d0fbd2a49; \>= 64836248dda20c8e7427b493f7e06d9bf8f58850, \< 71aeb8d01a8c7ab5cf7da3f81b35206f56ce6bca; \>= 64836248dda20c8e7427b493f7e06d9bf8f58850, \< 66f0919c953ef7b55e5ab94389a013da2ce80a2c
- Anyone running Linux 5.6

## Description

In the Linux kernel, the following vulnerability has been resolved:

tracing: kprobe: Fix memory leak in test\_gen\_kprobe/kretprobe\_cmd()

test\_gen\_kprobe\_cmd() only free buf in fail path, hence buf will leak
when there is no failure. Move kfree(buf) from fail path to common path
to prevent the memleak. The same reason and solution in
test\_gen\_kretprobe\_cmd().

unreferenced object 0xffff888143b14000 (size 2048):
  comm "insmod", pid 52490, jiffies 4301890980 (age 40.553s)
  hex dump (first 32 bytes):
    70 3a 6b 70 72 6f 62 65 73 2f 67 65 6e 5f 6b 70  p:kprobes/gen\_kp
    72 6f 62 65 5f 74 65 73 74 20 64 6f 5f 73 79 73  robe\_test do\_sys
  backtrace:
    \[\<000000006d7b836b\>\] kmalloc\_trace+0x27/0xa0
    \[\<0000000009528b5b\>\] 0xffffffffa059006f
    \[\<000000008408b580\>\] do\_one\_initcall+0x87/0x2a0
    \[\<00000000c4980a7e\>\] do\_init\_module+0xdf/0x320
    \[\<00000000d775aad0\>\] load\_module+0x3006/0x3390
    \[\<00000000e9a74b80\>\] \_\_do\_sys\_finit\_module+0x113/0x1b0
    \[\<000000003726480d\>\] do\_syscall\_64+0x35/0x80
    \[\<000000003441e93b\>\] entry\_SYSCALL\_64\_after\_hwframe+0x46/0xb0

## Affected and fixed versions

- Linux: \>= 64836248dda20c8e7427b493f7e06d9bf8f58850, \< bef08acbe560a926b4cee9cc46404cc98ae5703b; \>= 64836248dda20c8e7427b493f7e06d9bf8f58850, \< d1b6a8e3414aeaa0985139180c145d2d0fbd2a49; \>= 64836248dda20c8e7427b493f7e06d9bf8f58850, \< 71aeb8d01a8c7ab5cf7da3f81b35206f56ce6bca; \>= 64836248dda20c8e7427b493f7e06d9bf8f58850, \< 66f0919c953ef7b55e5ab94389a013da2ce80a2c (cvelist)
- Linux: 5.6 (cvelist)

## Mitigation

- Upgrade Linux to 66f0919c953ef7b55e5ab94389a013da2ce80a2c 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-49891. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-49891.md
Affected: Linux >= 64836248dda20c8e7427b493f7e06d9bf8f58850, < bef08acbe560a926b4cee9cc46404cc98ae5703b; >= 64836248dda20c8e7427b493f7e06d9bf8f58850, < d1b6a8e3414aeaa0985139180c145d2d0fbd2a49; >= 64836248dda20c8e7427b493f7e06d9bf8f58850, < 71aeb8d01a8c7ab5cf7da3f81b35206f56ce6bca; >= 64836248dda20c8e7427b49…
Fixed in: Linux 71aeb8d01a8c7ab5cf7da3f81b35206f56ce6bca, Linux 66f0919c953ef7b55e5ab94389a013da2ce80a2c

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-49891 being exploited?

There is no confirmed exploitation: CVE-2022-49891 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-49891?

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

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

Linux \>= 64836248dda20c8e7427b493f7e06d9bf8f58850, \< bef08acbe560a926b4cee9cc46404cc98ae5703b; \>= 64836248dda20c8e7427b493f7e06d9bf8f58850, \< d1b6a8e3414aeaa0985139180c145d2d0fbd2a49; \>= 64836248dda20c8e7427b493f7e06d9bf8f58850, \< 71aeb8d01a8c7ab5cf7da3f81b35206f56ce6bca; \>= 64836248dda20c8e7427b493f7e06d9bf8f58850, \< 66f0919c953ef7b55e5ab94389a013da2ce80a2c; Linux 5.6.

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

Yes. Fixed in Linux 71aeb8d01a8c7ab5cf7da3f81b35206f56ce6bca, Linux 66f0919c953ef7b55e5ab94389a013da2ce80a2c. Upgrade Linux to 66f0919c953ef7b55e5ab94389a013da2ce80a2c or later.

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

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/bef08acbe560a926b4cee9cc46404cc98ae5703b>
- patch: <https://git.kernel.org/stable/c/d1b6a8e3414aeaa0985139180c145d2d0fbd2a49>
- patch: <https://git.kernel.org/stable/c/71aeb8d01a8c7ab5cf7da3f81b35206f56ce6bca>
- patch: <https://git.kernel.org/stable/c/66f0919c953ef7b55e5ab94389a013da2ce80a2c>

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

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