CVE-2026-102957

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

7.7 high EPSS 0.19%

Published 25 Nov 2026 Updated 25 Nov 2026 CNA: zephyr

Check your servers for CVE-2026-102957

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2026-102957 affects zephyr, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

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.

Severity (CVSS)

7.7 high CVSS 3.1 from zephyr (CNA)
CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:L/I:H/A:H
Attack vector
local: the attacker needs local access, or a user has to open a prepared file
Attack complexity
high: an attack depends on conditions outside the control of the attacker, such as a race
Privileges required
low: the attacker needs an ordinary user account
User interaction
none: nobody has to click or open anything
Scope
changed: the damage reaches other components, such as the host of a container or other users
Impact
confidentiality low, integrity high, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.19%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 8.88% of all scored CVEs. Scores of 1 Dec 2026.

Weakness

  • CWE-825 Expired Pointer Dereference

Affected products

As the CNA lists them.

ProductVersions
zephyr
package zephyr
affected from 2.5.0, before 4.3.2
affected from 4.4.0, before 4.5.0
Other versions: unaffected

Is my server affected?

Find the installed version of zephyr and compare it with the fixed version of your distribution. Distributions often fix a CVE in a package version of their own, so the version number of the upstream project can mislead.

Debian, Ubuntu

dpkg -l | grep -i zephyr
# packages whose changelog names the CVE (fixed in the installed version)
zgrep -l CVE-2026-102957 /usr/share/doc/*/changelog.Debian.gz
# Ubuntu
pro fix CVE-2026-102957

RHEL, Rocky, Alma, Fedora

rpm -q zephyr
# lists the advisory while the fix is not installed
dnf updateinfo list --cve CVE-2026-102957

Alpine

apk list --installed | grep -i zephyr

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2026-102957
trivy image --scanners vuln IMAGE | grep CVE-2026-102957

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Patches and release notes

Other references

Source: the record CVE-2026-102957 of the CVE List (CVE Program), CVE Terms of Use; EPSS of FIRST; the CWE catalog of MITRE, CWE Terms of Use. The text of the record is shown as published. Data sources and licences.