# CVE-2022-50635: powerpc/kprobes: Fix null pointer reference in arch\_prepare\_kprobe()

> 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.28% (percentile 13, 2026-11-26)
- **Published:** 2025-12-09T00:00:08.590Z
- **Modified:** 2026-11-10T12:10:00.177Z

## Who should check

- Anyone running Linux \>= b4657f7650babc9bfb41ce875abe41b18604a105, \< 7f536a8cb62dd5c084f112373fc34cdb5168a813; \>= b4657f7650babc9bfb41ce875abe41b18604a105, \< 4eac4f6a86ae73ef4b772d37398beeba2fbfde4e; \>= b4657f7650babc9bfb41ce875abe41b18604a105, \< 5fd1b369387c53ee6c774ab86e32e362a1e537ac; \>= b4657f7650babc9bfb41ce875abe41b18604a105, \< 97f88a3d723162781d6cbfdc7b9617eefab55b19
- Anyone running Linux 5.8

## Description

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

powerpc/kprobes: Fix null pointer reference in arch\_prepare\_kprobe()

I found a null pointer reference in arch\_prepare\_kprobe():

  \# echo 'p cmdline\_proc\_show' \> kprobe\_events
  \# echo 'p cmdline\_proc\_show+16' \>\> kprobe\_events
  Kernel attempted to read user page (0) - exploit attempt? (uid: 0)
  BUG: Kernel NULL pointer dereference on read at 0x00000000
  Faulting instruction address: 0xc000000000050bfc
  Oops: Kernel access of bad area, sig: 11 \[\#1\]
  LE PAGE\_SIZE=64K MMU=Radix SMP NR\_CPUS=2048 NUMA PowerNV
  Modules linked in:
  CPU: 0 PID: 122 Comm: sh Not tainted 6.0.0-rc3-00007-gdcf8e5633e2e \#10
  NIP:  c000000000050bfc LR: c000000000050bec CTR: 0000000000005bdc
  REGS: c0000000348475b0 TRAP: 0300   Not tainted  (6.0.0-rc3-00007-gdcf8e5633e2e)
  MSR:  9000000000009033 \<SF,HV,EE,ME,IR,DR,RI,LE\>  CR: 88002444  XER: 20040006
  CFAR: c00000000022d100 DAR: 0000000000000000 DSISR: 40000000 IRQMASK: 0
  ...
  NIP arch\_prepare\_kprobe+0x10c/0x2d0
  LR  arch\_prepare\_kprobe+0xfc/0x2d0
  Call Trace:
    0xc0000000012f77a0 (unreliable)
    register\_kprobe+0x3c0/0x7a0
    \_\_register\_trace\_kprobe+0x140/0x1a0
    \_\_trace\_kprobe\_create+0x794/0x1040
    trace\_probe\_create+0xc4/0xe0
    create\_or\_delete\_trace\_kprobe+0x2c/0x80
    trace\_parse\_run\_command+0xf0/0x210
    probes\_write+0x20/0x40
    vfs\_write+0xfc/0x450
    ksys\_write+0x84/0x140
    system\_call\_exception+0x17c/0x3a0
    system\_call\_vectored\_common+0xe8/0x278
  --- interrupt: 3000 at 0x7fffa5682de0
  NIP:  00007fffa5682de0 LR: 0000000000000000 CTR: 0000000000000000
  REGS: c000000034847e80 TRAP: 3000   Not tainted  (6.0.0-rc3-00007-gdcf8e5633e2e)
  MSR:  900000000280f033 \<SF,HV,VEC,VSX,EE,PR,FP,ME,IR,DR,RI,LE\>  CR: 44002408  XER: 00000000

The address being probed has some special:

  cmdline\_proc\_show: Probe based on ftrace
  cmdline\_proc\_show+16: Probe for the next instruction at the ftrace location

The ftrace-based kprobe does not generate kprobe::ainsn::insn, it gets
set to NULL. In arch\_prepare\_kprobe() it will check for:

  ...
  prev = get\_kprobe(p-\>addr - 1);
  preempt\_enable\_no\_resched();
  if (prev && ppc\_inst\_prefixed(ppc\_inst\_read(prev-\>ainsn.insn))) {
  ...

If prev is based on ftrace, 'ppc\_inst\_read(prev-\>ainsn.insn)' will occur
with a null pointer reference. At this point prev-\>addr will not be a
prefixed instruction, so the check can be skipped.

Check if prev is ftrace-based kprobe before reading 'prev-\>ainsn.insn'
to fix this problem.

\[mpe: Trim oops\]

## Affected and fixed versions

- Linux: \>= b4657f7650babc9bfb41ce875abe41b18604a105, \< 7f536a8cb62dd5c084f112373fc34cdb5168a813; \>= b4657f7650babc9bfb41ce875abe41b18604a105, \< 4eac4f6a86ae73ef4b772d37398beeba2fbfde4e; \>= b4657f7650babc9bfb41ce875abe41b18604a105, \< 5fd1b369387c53ee6c774ab86e32e362a1e537ac; \>= b4657f7650babc9bfb41ce875abe41b18604a105, \< 97f88a3d723162781d6cbfdc7b9617eefab55b19 (cvelist)
- Linux: 5.8 (cvelist)

## Mitigation

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

Details: https://flawdb.com/CVE-2022-50635.md
Affected: Linux >= b4657f7650babc9bfb41ce875abe41b18604a105, < 7f536a8cb62dd5c084f112373fc34cdb5168a813; >= b4657f7650babc9bfb41ce875abe41b18604a105, < 4eac4f6a86ae73ef4b772d37398beeba2fbfde4e; >= b4657f7650babc9bfb41ce875abe41b18604a105, < 5fd1b369387c53ee6c774ab86e32e362a1e537ac; >= b4657f7650babc9bfb41ce8…
Fixed in: Linux 7f536a8cb62dd5c084f112373fc34cdb5168a813, Linux 4eac4f6a86ae73ef4b772d37398beeba2fbfde4e, Linux 5fd1b369387c53ee6c774ab86e32e362a1e537ac, Linux 97f88a3d723162781d6cbfdc7b9617eefab55b19

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

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

It has no CVSS score yet. Unknown.

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

Linux \>= b4657f7650babc9bfb41ce875abe41b18604a105, \< 7f536a8cb62dd5c084f112373fc34cdb5168a813; \>= b4657f7650babc9bfb41ce875abe41b18604a105, \< 4eac4f6a86ae73ef4b772d37398beeba2fbfde4e; \>= b4657f7650babc9bfb41ce875abe41b18604a105, \< 5fd1b369387c53ee6c774ab86e32e362a1e537ac; \>= b4657f7650babc9bfb41ce875abe41b18604a105, \< 97f88a3d723162781d6cbfdc7b9617eefab55b19; Linux 5.8.

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

Yes. Fixed in Linux 7f536a8cb62dd5c084f112373fc34cdb5168a813, Linux 4eac4f6a86ae73ef4b772d37398beeba2fbfde4e, Linux 5fd1b369387c53ee6c774ab86e32e362a1e537ac, Linux 97f88a3d723162781d6cbfdc7b9617eefab55b19. Upgrade Linux to 97f88a3d723162781d6cbfdc7b9617eefab55b19 or later.

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

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/7f536a8cb62dd5c084f112373fc34cdb5168a813>
- other: <https://git.kernel.org/stable/c/4eac4f6a86ae73ef4b772d37398beeba2fbfde4e>
- other: <https://git.kernel.org/stable/c/5fd1b369387c53ee6c774ab86e32e362a1e537ac>
- other: <https://git.kernel.org/stable/c/97f88a3d723162781d6cbfdc7b9617eefab55b19>

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

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