# CVE-2026-78118: Race condition on kernel wait queues: unlocked z\_waitq\_head() read in the timer expiration handler can yield a stale or sentinel thread pointer on SMP

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.0
- **CVSS:** 7.0 (v3.1, CNA) `CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: High; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; 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.11% (percentile 0, 2026-11-28)
- **CWE:** CWE-362
- **Published:** 2026-10-21T18:19:32.200Z
- **Modified:** 2026-10-23T22:17:00.450Z

## Who should check

- Anyone running zephyrproject zephyr \>= 2.2.0, \< 4.5.0

## Description

The kernel helper z\_waitq\_head() (kernel/include/wait\_q.h) reads the head of a thread wait queue, but on SMP systems it was called from several places without holding the scheduler spinlock \_sched\_spinlock that serializes wait-queue mutation. The consequential call site is z\_timer\_expiration\_handler() in kernel/timer.c, which held only the timer subsystem lock timer\_lock while reading timer-\>wait\_q and then unpending, setting the return value of, and readying the thread it obtained. halt\_thread() in kernel/sched.c removes an aborted thread from its wait queue while holding only \_sched\_spinlock, so the two paths are not mutually exclusive.

When the last waiter is removed on another CPU inside that window, sys\_dlist\_peek\_head() can return the list sentinel — a pointer into the k\_timer object itself — typed as a struct k\_thread \* (with CONFIG\_WAITQ\_SCALABLE, rb\_get\_min() can return an arbitrary node of a tree being restructured), or it can return a pointer to a thread that has already been unpended and, for dynamically allocated threads, freed. The handler then calls unpend\_thread\_no\_timeout(), which performs a sys\_dlist\_remove() through pointers read from that object, and arch\_thread\_return\_value\_set(), which writes unconditionally through the pointer.

The result is out-of-bounds and use-after-free writes in supervisor context, plus scheduler state corruption; a milder outcome is a thread that has re-pended elsewhere being woken with a success return value from an unrelated blocking call. All of the primitives needed to drive the interleaving — k\_timer\_start(), k\_timer\_status\_sync(), k\_thread\_create() and k\_thread\_abort() — are system calls, so with CONFIG\_USERSPACE enabled an unprivileged user-mode thread can attempt the race against kernel-owned data.

Exploitation requires a multi-CPU build (CONFIG\_MP\_MAX\_NUM\_CPUS greater than one; the affected region is a no-op on uniprocessor targets), local code execution, and winning a narrow timing window, so the practical outcome is most often a kernel crash rather than controlled corruption. The fix splits the helper into z\_waitq\_head\_locked() for callers that already hold the scheduler spinlock and a z\_waitq\_head() that acquires it, and brings the timer expiration handler's head read, unpend and ready under a single LOCK\_SCHED\_SPINLOCK region.

## Affected and fixed versions

- zephyrproject zephyr: \>= 2.2.0, \< 4.5.0 (cvelist)

## 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-78118. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-78118.md
Affected: zephyrproject zephyr >= 2.2.0, < 4.5.0
Fixed in: 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-78118 being exploited?

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

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

High: CVSS 7.0 (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-78118?

zephyrproject zephyr \>= 2.2.0, \< 4.5.0.

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

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

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

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-gm6w-pv43-m3vf>
- patch: <https://github.com/zephyrproject-rtos/zephyr/commit/a9b21fb354e8468dd15db307c3e599dc68b7ef33>

## 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-78118>

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