{"schemaVersion":4,"id":"CVE-2026-102957","aliases":[],"status":"published","duplicateOf":null,"title":"PWM capture syscall leaves callback armed on a dead kernel stack frame when called with K_NO_WAIT","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.","dates":{"published":"2026-11-25T20:27:16.717Z","modified":"2026-12-02T15:20:36.531Z","reserved":null,"kevAdded":[],"kevDue":[]},"cvss":{"headline":{"score":7.7,"severity":"high","version":"3.1","versionLabel":"v3.1","source":"CVE.org","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:L/I:H/A:H","computed":false,"selection":"backend-summary"},"metrics":[{"version":"3.1","versionLabel":"v3.1","source":"CVE.org","score":7.7,"severity":"high","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:L/I:H/A:H","exploitability":null,"impact":null,"computed":false},{"version":"3.1","versionLabel":"v3.1","source":"NVD","score":7.7,"severity":"high","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:L/I:H/A:H","exploitability":null,"impact":null,"computed":false}]},"epss":{"probability":0.00189,"percentile":0.08855,"severity":"low","asOf":"2026-12-04T00:00:00.000Z","change":{"pp":null,"baselineDate":null,"baselineScore":null},"history":[{"date":"2026-11-26T00:00:00.000Z","score":0.00189,"percentile":null},{"date":"2026-11-27T00:00:00.000Z","score":0.00189,"percentile":null},{"date":"2026-11-28T00:00:00.000Z","score":0.00189,"percentile":null},{"date":"2026-11-29T00:00:00.000Z","score":0.00189,"percentile":null},{"date":"2026-11-30T00:00:00.000Z","score":0.00189,"percentile":null},{"date":"2026-12-01T00:00:00.000Z","score":0.00189,"percentile":null},{"date":"2026-12-02T00:00:00.000Z","score":0.00189,"percentile":null},{"date":"2026-12-03T00:00:00.000Z","score":0.00189,"percentile":null},{"date":"2026-12-04T00:00:00.000Z","score":0.00189,"percentile":0.08855}],"last30":[{"date":"2026-11-26T00:00:00.000Z","score":0.00189,"percentile":null},{"date":"2026-11-27T00:00:00.000Z","score":0.00189,"percentile":null},{"date":"2026-11-28T00:00:00.000Z","score":0.00189,"percentile":null},{"date":"2026-11-29T00:00:00.000Z","score":0.00189,"percentile":null},{"date":"2026-11-30T00:00:00.000Z","score":0.00189,"percentile":null},{"date":"2026-12-01T00:00:00.000Z","score":0.00189,"percentile":null},{"date":"2026-12-02T00:00:00.000Z","score":0.00189,"percentile":null},{"date":"2026-12-03T00:00:00.000Z","score":0.00189,"percentile":null},{"date":"2026-12-04T00:00:00.000Z","score":0.00189,"percentile":0.08855}]},"kev":{"state":"not-listed","entries":[],"listedCount":0,"totalCatalogs":3,"catalogs":[{"source":"cisa","label":"CISA","listed":false,"entry":null},{"source":"enisa","label":"ENISA","listed":false,"entry":null},{"source":"circl","label":"CIRCL","listed":false,"entry":null}]},"ransomware":{"state":"none-recorded","sources":[]},"exploits":[],"exploitCount":0,"weaknesses":[{"id":"CWE-825","name":"Expired Pointer Dereference","description":"The product dereferences a pointer that contains a location for memory that was previously valid, but is no longer valid.","type":"weakness","status":"Incomplete","abstraction":"Base","likelihoodOfExploit":null,"url":"https://cwe.mitre.org/data/definitions/825.html"}],"affected":[{"vendor":"zephyrproject","product":"zephyr","name":"zephyr","label":"zephyr","ecosystem":null,"cpePart":"a","purl":null,"purlType":null,"versions":[{"text":"≥ 2.5.0, < 4.3.2","noFixRecorded":false,"fixedIn":null,"bounds":{"kind":"range","start":"2.5.0","startInclusive":true,"end":"4.3.2","endInclusive":false}},{"text":"≥ 4.4.0, < 4.5.0","noFixRecorded":false,"fixedIn":null,"bounds":{"kind":"range","start":"4.4.0","startInclusive":true,"end":"4.5.0","endInclusive":false}}],"versionsText":"≥ 2.5.0, < 4.3.2 | ≥ 4.4.0, < 4.5.0","eol":null,"hubHref":"/vendor/zephyrproject/zephyr"}],"affectedCount":1,"eol":{"hasEol":false,"count":0},"references":[{"url":"https://github.com/zephyrproject-rtos/zephyr/commit/cad8ad3ed2511d2816a3e8ce63e8028f7c3a1a1e","label":"github.com/zephyrproject-rtos/zephyr/commit/cad8ad3ed2511d2816a3e8ce63e8028f7c3a1a1e","hostname":"github.com","tags":["Patch"]},{"url":"https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-gmqw-xpww-374m","label":"github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-gmqw-xpww-374m","hostname":"github.com","tags":[]}],"lineage":{"upstream":[],"downstream":[],"duplicates":[],"related":[]},"timeline":[{"kind":"published","date":"2026-11-25T20:27:16.717Z","label":"Published","detail":"Vulnerability first disclosed.","source":null},{"kind":"modified","date":"2026-12-02T15:20:36.531Z","label":"Last modified","detail":"Vulnerability information updated.","source":null}],"priority":{"label":"routine","tag":null,"reason":"Not severe (CVSS 7.7, local access); no exploitation reported by the 5 checked sources","nextStep":"Fix in the normal cadence","rank":[0,0,0,0,0,77],"checkedSources":["cisa","enisa","circl","shadowserver","cisa-adp"],"evidence":[{"type":"epss","source":"FIRST","date":"2026-12-04T00:00:00.000Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"value":0.00189,"stale":false,"promoted":null},{"type":"cvss","source":"cve.org","date":"2026-12-02T15:20:36.531Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":7.7,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:L/I:H/A:H","version":"3.1","headline":true},{"type":"cvss","source":"nvd","date":"2026-12-02T15:20:36.531Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"score":7.7,"vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:C/C:L/I:H/A:H","version":"3.1"},{"type":"adp","source":"cisa-adp","date":"2026-12-02T15:20:21.590Z","status":"valid","statusDate":null,"statusSource":null,"disputes":[],"exploitation":"none"}],"epss":{"value":0.00189,"date":"2026-12-04T00:00:00.000Z","stale":false,"promoted":null},"sources":[{"id":"cisa","lastSuccessfulSync":"2026-12-05T11:16:59.273Z","state":"fresh"},{"id":"enisa","lastSuccessfulSync":"2026-12-05T11:16:59.802Z","state":"fresh"},{"id":"circl","lastSuccessfulSync":"2026-12-05T11:16:59.995Z","state":"fresh"},{"id":"shadowserver","lastSuccessfulSync":null,"state":"unavailable"},{"id":"cisa-adp","lastSuccessfulSync":"2026-12-05T11:01:01.512Z","state":"fresh"},{"id":"epss","lastSuccessfulSync":"2026-12-05T11:16:57.726Z","state":"fresh"},{"id":"osv","lastSuccessfulSync":"2026-12-05T11:16:56.764Z","state":"fresh"}],"feedEvent":null},"meta":{"dataAsOf":"2026-12-05T11:48:02.370Z","stale":false,"partial":false}}