# CVE-2022-50654: bpf: Fix panic due to wrong pageattr of im-\>image

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

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **EPSS:** 0.27% (percentile 13, 2026-11-26)
- **Published:** 2025-12-09T00:00:28.878Z
- **Modified:** 2026-11-10T12:10:00.177Z

## Who should check

- Anyone running Linux \>= 00963a2e75a872e5fce4d0115ac2786ec86b57a6, \< d9d383cbf812a3b4094c089aa5f5d41a3bb4531d; \>= 00963a2e75a872e5fce4d0115ac2786ec86b57a6, \< 7f656fff955ccb216c40fa188a24c05fa40985a5; \>= 00963a2e75a872e5fce4d0115ac2786ec86b57a6, \< 9ed1d9aeef5842ecacb660fce933613b58af1e00
- Anyone running Linux 6.0

## Description

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

bpf: Fix panic due to wrong pageattr of im-\>image

In the scenario where livepatch and kretfunc coexist, the pageattr of
im-\>image is rox after arch\_prepare\_bpf\_trampoline in
bpf\_trampoline\_update, and then modify\_fentry or register\_fentry returns
-EAGAIN from bpf\_tramp\_ftrace\_ops\_func, the BPF\_TRAMP\_F\_ORIG\_STACK flag
will be configured, and arch\_prepare\_bpf\_trampoline will be re-executed.

At this time, because the pageattr of im-\>image is rox,
arch\_prepare\_bpf\_trampoline will read and write im-\>image, which causes
a fault. as follows:

  insmod livepatch-sample.ko    \# samples/livepatch/livepatch-sample.c
  bpftrace -e 'kretfunc:cmdline\_proc\_show {}'

BUG: unable to handle page fault for address: ffffffffa0206000
PGD 322d067 P4D 322d067 PUD 322e063 PMD 1297e067 PTE d428061
Oops: 0003 \[\#1\] PREEMPT SMP PTI
CPU: 2 PID: 270 Comm: bpftrace Tainted: G            E K    6.1.0 \#5
RIP: 0010:arch\_prepare\_bpf\_trampoline+0xed/0x8c0
RSP: 0018:ffffc90001083ad8 EFLAGS: 00010202
RAX: ffffffffa0206000 RBX: 0000000000000020 RCX: 0000000000000000
RDX: ffffffffa0206001 RSI: ffffffffa0206000 RDI: 0000000000000030
RBP: ffffc90001083b70 R08: 0000000000000066 R09: ffff88800f51b400
R10: 000000002e72c6e5 R11: 00000000d0a15080 R12: ffff8880110a68c8
R13: 0000000000000000 R14: ffff88800f51b400 R15: ffffffff814fec10
FS:  00007f87bc0dc780(0000) GS:ffff88803e600000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: ffffffffa0206000 CR3: 0000000010b70000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
Call Trace:
\<TASK\>
 bpf\_trampoline\_update+0x25a/0x6b0
 \_\_bpf\_trampoline\_link\_prog+0x101/0x240
 bpf\_trampoline\_link\_prog+0x2d/0x50
 bpf\_tracing\_prog\_attach+0x24c/0x530
 bpf\_raw\_tp\_link\_attach+0x73/0x1d0
 \_\_sys\_bpf+0x100e/0x2570
 \_\_x64\_sys\_bpf+0x1c/0x30
 do\_syscall\_64+0x5b/0x80
 entry\_SYSCALL\_64\_after\_hwframe+0x63/0xcd

With this patch, when modify\_fentry or register\_fentry returns -EAGAIN
from bpf\_tramp\_ftrace\_ops\_func, the pageattr of im-\>image will be reset
to nx+rw.

## Affected and fixed versions

- Linux: \>= 00963a2e75a872e5fce4d0115ac2786ec86b57a6, \< d9d383cbf812a3b4094c089aa5f5d41a3bb4531d; \>= 00963a2e75a872e5fce4d0115ac2786ec86b57a6, \< 7f656fff955ccb216c40fa188a24c05fa40985a5; \>= 00963a2e75a872e5fce4d0115ac2786ec86b57a6, \< 9ed1d9aeef5842ecacb660fce933613b58af1e00 (cvelist)
- Linux: 6.0 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2022-50654.md
Affected: Linux >= 00963a2e75a872e5fce4d0115ac2786ec86b57a6, < d9d383cbf812a3b4094c089aa5f5d41a3bb4531d; >= 00963a2e75a872e5fce4d0115ac2786ec86b57a6, < 7f656fff955ccb216c40fa188a24c05fa40985a5; >= 00963a2e75a872e5fce4d0115ac2786ec86b57a6, < 9ed1d9aeef5842ecacb660fce933613b58af1e00; Linux 6.0
Fixed in: Linux 7f656fff955ccb216c40fa188a24c05fa40985a5, Linux 9ed1d9aeef5842ecacb660fce933613b58af1e00

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

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

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

It has no CVSS score yet. Unknown.

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

Linux \>= 00963a2e75a872e5fce4d0115ac2786ec86b57a6, \< d9d383cbf812a3b4094c089aa5f5d41a3bb4531d; \>= 00963a2e75a872e5fce4d0115ac2786ec86b57a6, \< 7f656fff955ccb216c40fa188a24c05fa40985a5; \>= 00963a2e75a872e5fce4d0115ac2786ec86b57a6, \< 9ed1d9aeef5842ecacb660fce933613b58af1e00; Linux 6.0.

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

Yes. Fixed in Linux 7f656fff955ccb216c40fa188a24c05fa40985a5, Linux 9ed1d9aeef5842ecacb660fce933613b58af1e00. Upgrade Linux to 9ed1d9aeef5842ecacb660fce933613b58af1e00 or later.

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

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

- other: <https://git.kernel.org/stable/c/d9d383cbf812a3b4094c089aa5f5d41a3bb4531d>
- other: <https://git.kernel.org/stable/c/7f656fff955ccb216c40fa188a24c05fa40985a5>
- other: <https://git.kernel.org/stable/c/9ed1d9aeef5842ecacb660fce933613b58af1e00>

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

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