Skip to content

zephyr

PWM capture syscall leaves callback armed on a dead kernel stack frame when called with K_NO_WAIT

CVE-2026-102957Published 25 Nov 2026, 20:27 UTC

Real-world risk

1.3/ 10Low

Routine

PreliminaryFrom the CVSS vector only · confidence low

CVSS

7.7

scored by the vendor (CNA), CVSS 3.1

In plain words

No plain-language summary yet. The original description is below.

Original description (from zephyr)

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.

Am I affected?

ProductAffected versions (from the sources)Fixed in
zephyrNiche>= 2.5.0, < 4.3.2; >= 4.4.0, < 4.5.04.3.2, 4.5.0

What to do

Update to a fixed version: 4.3.2, 4.5.0.

Why this score

FactorValueEvidence×
ImpactMajor data tamperingWrites or changes important data without gaining executionFrom the CVSS vector0.70
Attacker positionLocalMust already run code or have a shell on the machineFrom the CVSS vector0.50
Privileges neededLowA real low-privileged accountFrom the CVSS vector1.00
Victim interactionNoneNothingFrom the CVSS vector1.00
ConfigurationDefaultOut-of-the-box installs are vulnerableFrom the CVSS vector1.00
ReliabilityHardNarrow race, needs an extra info leak, needs a man-in-the-middle position, or must be chained with another bugFrom the CVSS vector0.45

Threat level T1: Nothing known (× 0.85)

The default for a new disclosure

EPSS 0.2% chance of exploitation in 30 days (percentile 9), as of 2026-12-02.

The arithmetic
  1. Prerequisites multiplied together0.225
  2. Threat T1: Nothing known0.850
  3. 10 × impact 0.7 × prerequisites 0.225 × threat 0.851.339
  4. Rounded to one decimal between 0.1 and 101.3

How the score works

Exploitation and evidence timeline

  1. 25 Nov 2026 Published
  2. 2 Dec 2026 Risk 1.3 (cvss fallback)

Weakness

CWE-825

References

Get alerts for zephyr

Free email or text alerts when a vulnerability in zephyr reaches risk 8 or higher. Nothing else.