{"id":"CVE-2026-102957","aliases":[],"cve":{"records":[{"id":"CVE-2026-102957","source":"zephyr","state":"PUBLISHED","reasons":[],"replacements":[],"disputed":false,"unsupportedWhenAssigned":false,"reserved":"2026-09-29T20:25:26.925Z","published":"2026-11-25T20:27:16.717Z","modified":"2026-11-25T20:27:16.717Z"}],"publishers":[{"name":"zephyr","role":"CNA","organizationId":"e2e69745-5e70-4e92-8431-deb5529a81ad","modified":"2026-11-25T20:27:16.717Z"}],"references":[{"url":"https://github.com/zephyrproject-rtos/zephyr/commit/cad8ad3ed2511d2816a3e8ce63e8028f7c3a1a1e","tags":["patch"],"source":"zephyr"},{"url":"https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-gmqw-xpww-374m","tags":[],"source":"zephyr"}],"weaknesses":[{"id":"CWE-825","description":"memory-safety","source":"zephyr"}],"applicability":[],"prioritization":[]},"title":"PWM capture syscall leaves callback armed on a dead kernel stack frame when called with K_NO_WAIT","titleSource":"zephyr","descriptionSource":"zephyr","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.\n\npwm_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.\n\nThe 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.","score":7.7,"severity":"high","published":"2026-11-25T20:27:16.717Z","modified":"2026-11-25T20:27:16.717Z","withdrawn":false,"knownExploited":false,"affected":[],"products":[{"vendor":"zephyrproject","name":"zephyr","platforms":[],"versions":[{"version":"2.5.0","status":"affected","lessThan":"4.3.2","versionType":"semver"},{"version":"4.4.0","status":"affected","lessThan":"4.5.0","versionType":"semver"}],"defaultStatus":"unaffected","cpes":[],"source":"zephyr","url":"https://www.cve.org/CVERecord?id=CVE-2026-102957"}],"remediation":[],"references":["https://github.com/zephyrproject-rtos/zephyr/commit/cad8ad3ed2511d2816a3e8ce63e8028f7c3a1a1e","https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-gmqw-xpww-374m"],"sources":[{"name":"CVE","id":"CVE-2026-102957","modified":"2026-11-25T20:27:16.717Z","url":"https://www.cve.org/CVERecord?id=CVE-2026-102957"}],"assessments":[{"source":"zephyr","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:L/I:H/A:H","score":7.7}],"sourceAffected":[],"observedAt":"2026-11-25T21:08:42.229Z","kev":{"status":"not-listed","checkedAt":"2026-11-29T22:15:32.947Z"},"coverage":[{"source":"NVD","status":"available","checkedAt":"2026-11-25T21:40:32.333Z","attemptedAt":"2026-11-25T21:40:32.333Z"},{"source":"GHSA","status":"no-result","checkedAt":"2026-11-25T21:40:32.335Z","attemptedAt":"2026-11-25T21:40:32.335Z"},{"source":"EUVD","status":"no-result","checkedAt":"2026-11-25T21:40:32.335Z","attemptedAt":"2026-11-25T21:40:32.335Z"},{"source":"EPSS","status":"no-result","checkedAt":"2026-11-25T21:40:30.472Z","attemptedAt":"2026-11-25T21:40:30.472Z"}],"evidence":[{"source":"NVD","id":"CVE-2026-102957","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-102957","modified":"2026-11-25T21:17:15.900","score":7.7,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:L/I:H/A:H","checkedAt":"2026-11-25T21:40:32.333Z"}],"aiSummary":{"text":"Zephyr versions 2.5.0 to 4.3.2 and 4.4.0 to 4.5.0 have a memory-safety weakness. An unprivileged user-mode thread can trigger kernel memory corruption via a PWM capture syscall with K_NO_WAIT. This may lead to a crash or privilege escalation.","model":"@cf/meta/llama-3.3-70b-instruct-fp8-fast","generatedAt":"2026-11-25T21:16:13.385Z","sources":[{"name":"CVE","url":"https://www.cve.org/CVERecord?id=CVE-2026-102957"}]}}