# CVE-2022-49006: tracing: Free buffers when a used dynamic event is removed

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

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; 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.32% (percentile 17, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2024-10-21T20:06:18.840Z
- **Modified:** 2026-06-17T05:16:49.920Z

## Who should check

- Anyone running Linux \>= 77b44d1b7c28360910cdbd427fb62d485c08674c, \< 1603feac154ff38514e8354e3079a455eb4801e2; \>= 77b44d1b7c28360910cdbd427fb62d485c08674c, \< be111ebd8868d4b7c041cb3c6102e1ae27d6dc1d; \>= 77b44d1b7c28360910cdbd427fb62d485c08674c, \< 417d5ea6e735e5d88ffb6c436cf2938f3f476dd1; \>= 77b44d1b7c28360910cdbd427fb62d485c08674c, \< c52d0c8c4f38f7580cff61c4dfe1034c580cedfd; \>= 77b44d1b7c28360910cdbd427fb62d485c08674c, \< 4313e5a613049dfc1819a6dfb5f94cf2caff9452
- Anyone running Linux 2.6.33

## Description

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

tracing: Free buffers when a used dynamic event is removed

After 65536 dynamic events have been added and removed, the "type" field
of the event then uses the first type number that is available (not
currently used by other events). A type number is the identifier of the
binary blobs in the tracing ring buffer (known as events) to map them to
logic that can parse the binary blob.

The issue is that if a dynamic event (like a kprobe event) is traced and
is in the ring buffer, and then that event is removed (because it is
dynamic, which means it can be created and destroyed), if another dynamic
event is created that has the same number that new event's logic on
parsing the binary blob will be used.

To show how this can be an issue, the following can crash the kernel:

 \# cd /sys/kernel/tracing
 \# for i in \`seq 65536\`; do
     echo 'p:kprobes/foo do\_sys\_openat2 $arg1:u32' \> kprobe\_events
 \# done

For every iteration of the above, the writing to the kprobe\_events will
remove the old event and create a new one (with the same format) and
increase the type number to the next available on until the type number
reaches over 65535 which is the max number for the 16 bit type. After it
reaches that number, the logic to allocate a new number simply looks for
the next available number. When an dynamic event is removed, that number
is then available to be reused by the next dynamic event created. That is,
once the above reaches the max number, the number assigned to the event in
that loop will remain the same.

Now that means deleting one dynamic event and created another will reuse
the previous events type number. This is where bad things can happen.
After the above loop finishes, the kprobes/foo event which reads the
do\_sys\_openat2 function call's first parameter as an integer.

 \# echo 1 \> kprobes/foo/enable
 \# cat /etc/passwd \> /dev/null
 \# cat trace
             cat-2211    \[005\] ....  2007.849603: foo: (do\_sys\_openat2+0x0/0x130) arg1=4294967196
             cat-2211    \[005\] ....  2007.849620: foo: (do\_sys\_openat2+0x0/0x130) arg1=4294967196
             cat-2211    \[005\] ....  2007.849838: foo: (do\_sys\_openat2+0x0/0x130) arg1=4294967196
             cat-2211    \[005\] ....  2007.849880: foo: (do\_sys\_openat2+0x0/0x130) arg1=4294967196
 \# echo 0 \> kprobes/foo/enable

Now if we delete the kprobe and create a new one that reads a string:

 \# echo 'p:kprobes/foo do\_sys\_openat2 +0($arg2):string' \> kprobe\_events

And now we can the trace:

 \# cat trace
        sendmail-1942    \[002\] .....   530.136320: foo: (do\_sys\_openat2+0x0/0x240) arg1=             cat-2046    \[004\] .....   530.930817: foo: (do\_sys\_openat2+0x0/0x240) arg1="������������������������������������������������������������������������������������������������"
             cat-2046    \[004\] .....   530.930961: foo: (do\_sys\_openat2+0x0/0x240) arg1="������������������������������������������������������������������������������������������������"
             cat-2046    \[004\] .....   530.934278: foo: (do\_sys\_openat2+0x0/0x240) arg1="������������������������������������������������������������������������������������������������"
             cat-2046    \[004\] .....   530.934563: foo: (do\_sys\_openat2+0x0/0x240) arg1="���������������������������������������
---truncated---

## Affected and fixed versions

- Linux: \>= 77b44d1b7c28360910cdbd427fb62d485c08674c, \< 1603feac154ff38514e8354e3079a455eb4801e2; \>= 77b44d1b7c28360910cdbd427fb62d485c08674c, \< be111ebd8868d4b7c041cb3c6102e1ae27d6dc1d; \>= 77b44d1b7c28360910cdbd427fb62d485c08674c, \< 417d5ea6e735e5d88ffb6c436cf2938f3f476dd1; \>= 77b44d1b7c28360910cdbd427fb62d485c08674c, \< c52d0c8c4f38f7580cff61c4dfe1034c580cedfd; \>= 77b44d1b7c28360910cdbd427fb62d485c08674c, \< 4313e5a613049dfc1819a6dfb5f94cf2caff9452 (cvelist)
- Linux: 2.6.33 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2022-49006.md
Affected: Linux >= 77b44d1b7c28360910cdbd427fb62d485c08674c, < 1603feac154ff38514e8354e3079a455eb4801e2; >= 77b44d1b7c28360910cdbd427fb62d485c08674c, < be111ebd8868d4b7c041cb3c6102e1ae27d6dc1d; >= 77b44d1b7c28360910cdbd427fb62d485c08674c, < 417d5ea6e735e5d88ffb6c436cf2938f3f476dd1; >= 77b44d1b7c28360910cdbd4…
Fixed in: Linux 1603feac154ff38514e8354e3079a455eb4801e2, Linux 417d5ea6e735e5d88ffb6c436cf2938f3f476dd1, Linux 4313e5a613049dfc1819a6dfb5f94cf2caff9452

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

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

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

High: CVSS 7.8 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= 77b44d1b7c28360910cdbd427fb62d485c08674c, \< 1603feac154ff38514e8354e3079a455eb4801e2; \>= 77b44d1b7c28360910cdbd427fb62d485c08674c, \< be111ebd8868d4b7c041cb3c6102e1ae27d6dc1d; \>= 77b44d1b7c28360910cdbd427fb62d485c08674c, \< 417d5ea6e735e5d88ffb6c436cf2938f3f476dd1; \>= 77b44d1b7c28360910cdbd427fb62d485c08674c, \< c52d0c8c4f38f7580cff61c4dfe1034c580cedfd; \>= 77b44d1b7c28360910cdbd427fb62d485c08674c, \< 4313e5a613049dfc1819a6dfb5f94cf2caff9452; Linux 2.6.33.

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

Yes. Fixed in Linux 1603feac154ff38514e8354e3079a455eb4801e2, Linux 417d5ea6e735e5d88ffb6c436cf2938f3f476dd1, Linux 4313e5a613049dfc1819a6dfb5f94cf2caff9452. Upgrade Linux to 4313e5a613049dfc1819a6dfb5f94cf2caff9452 or later.

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

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/1603feac154ff38514e8354e3079a455eb4801e2>
- patch: <https://git.kernel.org/stable/c/be111ebd8868d4b7c041cb3c6102e1ae27d6dc1d>
- patch: <https://git.kernel.org/stable/c/417d5ea6e735e5d88ffb6c436cf2938f3f476dd1>
- patch: <https://git.kernel.org/stable/c/c52d0c8c4f38f7580cff61c4dfe1034c580cedfd>
- patch: <https://git.kernel.org/stable/c/4313e5a613049dfc1819a6dfb5f94cf2caff9452>

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

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