# CVE-2026-102957: PWM capture syscall leaves callback armed on a dead kernel stack frame when called with K\_NO\_WAIT

- **Severity:** HIGH 7.7
- **CVSS:** 7.7 (v3.1, CNA) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:L/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; Privileges required: Low; User interaction: None; Scope: Changed (impact reaches other components); Confidentiality impact: Low; 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.19% (percentile 5, 2026-11-29)
- **CWE:** CWE-825
- **Published:** 2026-11-25T20:27:16.717Z
- **Modified:** 2026-11-25T21:17:15.900Z

> **AI summary (AI-generated, claude-haiku-5-5):** An unprivileged user-mode thread can pass K\_NO\_WAIT to the PWM capture syscall, leaving a callback pointing at a dead kernel stack frame that corrupts kernel memory in Zephyr.

## Who should check

- Anyone running zephyrproject zephyr \>= 2.5.0, \< 4.3.2; \>= 4.4.0, \< 4.5.0

## Description

z\_impl\_pwm\_capture\_cycles() in drivers/pwm/pwm\_capture.c stores its capture context (struct z\_pwm\_capture\_cb\_data, including a struct k\_sem) on its own stack and registers a pointer to it as the driver capture callback's user\_data. When called with a K\_NO\_WAIT timeout, k\_sem\_take() returns -EBUSY, which the function did not handle: it fell through, returned the uninitialized status field, copied uninitialized period/pulse values to the caller when that status happened to be zero, and returned without disabling the capture or clearing the callback.

pwm\_capture\_cycles() is a system call, and z\_vrfy\_pwm\_capture\_cycles() passes the caller's timeout through unchanged. With CONFIG\_USERSPACE and CONFIG\_PWM\_CAPTURE enabled, an unprivileged user-mode thread that has been granted access to a capture-capable PWM device can pass K\_NO\_WAIT to trigger the defect. Without userspace the function is only reachable from trusted application code.

The uninitialized values come from the thread's privileged (kernel) stack, so a user-mode caller can read up to 8 bytes of stale kernel stack memory per call. More seriously, when the capture later completes, the driver ISR invokes z\_pwm\_capture\_cycles\_callback() with the dangling pointer. The callback writes into the expired kernel stack region and calls k\_sem\_give() on whatever memory now occupies it, which can corrupt live kernel stack frames and make the scheduler walk a forged wait queue. The result is kernel memory corruption from interrupt context, leading at least to a crash and possibly to privilege escalation out of the userspace sandbox. The fix rejects K\_NO\_WAIT with -EINVAL before any capture is configured.

## Affected and fixed versions

- zephyrproject zephyr: \>= 2.5.0, \< 4.3.2; \>= 4.4.0, \< 4.5.0 (cvelist)

## Technologies

Zephyr RTOS

## Mitigation

- Upgrade zephyr to 4.5.0 or later.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2026-102957. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-102957.md
Affected: zephyrproject zephyr >= 2.5.0, < 4.3.2; >= 4.4.0, < 4.5.0
Fixed in: zephyrproject zephyr 4.3.2, zephyrproject zephyr 4.5.0

Steps:
1. Search this machine and project for zephyrproject zephyr: 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-2026-102957 being exploited?

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

### How serious is CVE-2026-102957?

High: CVSS 7.7 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed). The attack needs conditions outside the attacker's control, which makes it harder.

### Which versions are affected by CVE-2026-102957?

zephyrproject zephyr \>= 2.5.0, \< 4.3.2; \>= 4.4.0, \< 4.5.0.

### Is there a fix for CVE-2026-102957?

Yes. Fixed in zephyrproject zephyr 4.3.2, zephyrproject zephyr 4.5.0. Upgrade zephyr to 4.5.0 or later.

### How do I check if I'm affected by CVE-2026-102957?

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

- vendor: <https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-gmqw-xpww-374m>
- patch: <https://github.com/zephyrproject-rtos/zephyr/commit/cad8ad3ed2511d2816a3e8ce63e8028f7c3a1a1e>

## 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-2026-102957>
- FIRST EPSS: EPSS scores by FIRST <https://www.first.org/epss/>

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