# CVE-2022-49402: ftrace: Clean up hash direct\_functions on register failures

> 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, NVD) `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 14, 2026-11-26)
- **Published:** 2025-02-26T02:12:29.070Z
- **Modified:** 2026-11-05T20:17:05.700Z

## Who should check

- Anyone running Linux \>= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, \< 82c888e51c2176a06f8b4541cf748ee81aac6e7e; \>= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, \< cae2978d6907ef2c08b9b15f704e783f7c284713; \>= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, \< 805e87af946d8d2954171361e64d143ff37a441b; \>= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, \< a0392833a178cf109a57c2a9d4d531bdfc6cd98f; \>= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, \< 7d54c15cb89a29a5f59e5ffc9ee62e6591769ef1
- Anyone running Linux 5.5

## Description

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

ftrace: Clean up hash direct\_functions on register failures

We see the following GPF when register\_ftrace\_direct fails:

\[ \] general protection fault, probably for non-canonical address \\
  0x200000000000010: 0000 \[\#1\] PREEMPT SMP DEBUG\_PAGEALLOC PTI
\[...\]
\[ \] RIP: 0010:ftrace\_find\_rec\_direct+0x53/0x70
\[ \] Code: 48 c1 e0 03 48 03 42 08 48 8b 10 31 c0 48 85 d2 74 \[...\]
\[ \] RSP: 0018:ffffc9000138bc10 EFLAGS: 00010206
\[ \] RAX: 0000000000000000 RBX: ffffffff813e0df0 RCX: 000000000000003b
\[ \] RDX: 0200000000000000 RSI: 000000000000000c RDI: ffffffff813e0df0
\[ \] RBP: ffffffffa00a3000 R08: ffffffff81180ce0 R09: 0000000000000001
\[ \] R10: ffffc9000138bc18 R11: 0000000000000001 R12: ffffffff813e0df0
\[ \] R13: ffffffff813e0df0 R14: ffff888171b56400 R15: 0000000000000000
\[ \] FS:  00007fa9420c7780(0000) GS:ffff888ff6a00000(0000) knlGS:000000000
\[ \] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
\[ \] CR2: 000000000770d000 CR3: 0000000107d50003 CR4: 0000000000370ee0
\[ \] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
\[ \] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
\[ \] Call Trace:
\[ \]  \<TASK\>
\[ \]  register\_ftrace\_direct+0x54/0x290
\[ \]  ? render\_sigset\_t+0xa0/0xa0
\[ \]  bpf\_trampoline\_update+0x3f5/0x4a0
\[ \]  ? 0xffffffffa00a3000
\[ \]  bpf\_trampoline\_link\_prog+0xa9/0x140
\[ \]  bpf\_tracing\_prog\_attach+0x1dc/0x450
\[ \]  bpf\_raw\_tracepoint\_open+0x9a/0x1e0
\[ \]  ? find\_held\_lock+0x2d/0x90
\[ \]  ? lock\_release+0x150/0x430
\[ \]  \_\_sys\_bpf+0xbd6/0x2700
\[ \]  ? lock\_is\_held\_type+0xd8/0x130
\[ \]  \_\_x64\_sys\_bpf+0x1c/0x20
\[ \]  do\_syscall\_64+0x3a/0x80
\[ \]  entry\_SYSCALL\_64\_after\_hwframe+0x44/0xae
\[ \] RIP: 0033:0x7fa9421defa9
\[ \] Code: 00 c3 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 9 f8 \[...\]
\[ \] RSP: 002b:00007ffed743bd78 EFLAGS: 00000246 ORIG\_RAX: 0000000000000141
\[ \] RAX: ffffffffffffffda RBX: 00000000069d2480 RCX: 00007fa9421defa9
\[ \] RDX: 0000000000000078 RSI: 00007ffed743bd80 RDI: 0000000000000011
\[ \] RBP: 00007ffed743be00 R08: 0000000000bb7270 R09: 0000000000000000
\[ \] R10: 00000000069da210 R11: 0000000000000246 R12: 0000000000000001
\[ \] R13: 00007ffed743c4b0 R14: 00000000069d2480 R15: 0000000000000001
\[ \]  \</TASK\>
\[ \] Modules linked in: klp\_vm(OK)
\[ \] ---\[ end trace 0000000000000000 \]---

One way to trigger this is:
  1. load a livepatch that patches kernel function xxx;
  2. run bpftrace -e 'kfunc:xxx {}', this will fail (expected for now);
  3. repeat \#2 =\> gpf.

This is because the entry is added to direct\_functions, but not removed.
Fix this by remove the entry from direct\_functions when
register\_ftrace\_direct fails.

Also remove the last trailing space from ftrace.c, so we don't have to
worry about it anymore.

## Affected and fixed versions

- Linux: \>= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, \< 82c888e51c2176a06f8b4541cf748ee81aac6e7e; \>= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, \< cae2978d6907ef2c08b9b15f704e783f7c284713; \>= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, \< 805e87af946d8d2954171361e64d143ff37a441b; \>= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, \< a0392833a178cf109a57c2a9d4d531bdfc6cd98f; \>= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, \< 7d54c15cb89a29a5f59e5ffc9ee62e6591769ef1 (cvelist)
- Linux: 5.5 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2022-49402.md
Affected: Linux >= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, < 82c888e51c2176a06f8b4541cf748ee81aac6e7e; >= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, < cae2978d6907ef2c08b9b15f704e783f7c284713; >= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, < 805e87af946d8d2954171361e64d143ff37a441b; >= 763e34e74bb7d5c316015e2…
Fixed in: Linux 82c888e51c2176a06f8b4541cf748ee81aac6e7e, Linux 805e87af946d8d2954171361e64d143ff37a441b, Linux 7d54c15cb89a29a5f59e5ffc9ee62e6591769ef1

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

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

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

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

Linux \>= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, \< 82c888e51c2176a06f8b4541cf748ee81aac6e7e; \>= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, \< cae2978d6907ef2c08b9b15f704e783f7c284713; \>= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, \< 805e87af946d8d2954171361e64d143ff37a441b; \>= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, \< a0392833a178cf109a57c2a9d4d531bdfc6cd98f; \>= 763e34e74bb7d5c316015e2e39fcc8520bfd071c, \< 7d54c15cb89a29a5f59e5ffc9ee62e6591769ef1; Linux 5.5.

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

Yes. Fixed in Linux 82c888e51c2176a06f8b4541cf748ee81aac6e7e, Linux 805e87af946d8d2954171361e64d143ff37a441b, Linux 7d54c15cb89a29a5f59e5ffc9ee62e6591769ef1. Upgrade Linux to 7d54c15cb89a29a5f59e5ffc9ee62e6591769ef1 or later.

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

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/82c888e51c2176a06f8b4541cf748ee81aac6e7e>
- patch: <https://git.kernel.org/stable/c/cae2978d6907ef2c08b9b15f704e783f7c284713>
- patch: <https://git.kernel.org/stable/c/805e87af946d8d2954171361e64d143ff37a441b>
- patch: <https://git.kernel.org/stable/c/a0392833a178cf109a57c2a9d4d531bdfc6cd98f>
- patch: <https://git.kernel.org/stable/c/7d54c15cb89a29a5f59e5ffc9ee62e6591769ef1>

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

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