---
id: "CVE-2026-85032"
kind: "vulnerability"
aliases: ["CVE-2026-85032"]
title: "Zephyr MCTP USB: race between RX worker and disable frees live buffer"
severity: "medium"
cvss: 4.8
epss: null
exploited: false
status: "open"
category: "runtime"
products: []
ecosystems: []
tags: ["embedded", "mctp", "runtime", "usb", "zephyr"]
not_affected_if: ["mctp-usb-disabled", "no-untrusted-usb-host"]
published_at: "2026-11-03T14:17:38+00:00"
first_seen_at: "2026-11-03T14:21:08+00:00"
updated_at: "2026-11-03T14:22:06+00:00"
sources: [{"source": "nvd", "url": "https://nvd.nist.gov/vuln/detail/CVE-2026-85032", "first_seen_at": "2026-11-03T14:21:08+00:00"}]
---

# Zephyr MCTP USB: race between RX worker and disable frees live buffer

The MCTP over USB driver in Zephyr can free a packet buffer while its receive worker is still writing to it when the USB host changes configuration or resets the bus. A USB host that repeatedly triggers these events can corrupt the MCTP heap or fault the device.

_Summary, check and fix written by a model from the sources; labelled as such._

## How to check

- Check whether the build enables `CONFIG_MCTP_USB`, since only builds with that option are affected.
- Check whether the Zephyr tree includes `subsys/pmci/mctp/mctp_usb.c` using `k_work_cancel()` without the `k_work_cancel_sync()` fix.
- Check whether `CONFIG_SMP` or a preemptible `CONFIG_SYSTEM_WORKQUEUE_PRIORITY` is set; the heap-corruption path needs it, while the default cooperative workqueue can still fault on a NULL dereference.

## Timeline

- 2026-11-03T14:21:08+00:00 nvd https://nvd.nist.gov/vuln/detail/CVE-2026-85032

## Documents

- [advisory] Vendor advisory: github.com https://github.com/zephyrproject-rtos/zephyr/security/advisories/GHSA-pp5m-jr2h-qp3f
- [fix] Patch: github.com https://github.com/zephyrproject-rtos/zephyr/commit/277424084e740da5d61a17f40bea3457fa593acc

## From the sources

The MCTP over USB device class in subsys/pmci/mctp/mctp_usb.c splits RX handling across two threads: the system workqueue runs mctp_usb_class_out_work(), which parses host OUT data byte by byte and fills a packet buffer at usb->rx_pkt, while the USB device stack thread runs mctp_usb_class_disable(). The disable handler used k_work_cancel(), which removes a queued work item but returns immediately without waiting for a handler that is already running, and then called mctp_usb_reset_rx_state() to mctp_pktbuf_free() the packet buffer the worker may still be using.

Both entry points into mctp_usb_class_disable() are driven by the attached USB host: a SET_CONFIGURATION request and a USB bus reset both reach it via usbd_config_reset() in subsys/usb/device_next/usbd_config.c. A host that streams partial MCTP frames on the bulk OUT endpoint and repeatedly forces a configuration change or bus reset therefore controls both the data being parsed and the moment the teardown runs, and can retry the race indefinitely without credentials or user interaction.

If the free lands while the worker holds the pointer, the worker writes host-supplied bytes into freed memory of the dedicated MCTP heap (CONFIG_MCTP_HEAP_SIZE in subsys/pmci/mctp/mctp_memory.c), corrupting recycled buffers or sys_heap free-block metadata; this window requires genuine parallelism, i.e. CONFIG_SMP or a preemptible CONFIG_SYSTEM_WORKQUEUE_PRIORITY. With the default cooperative workqueue the worker can still yield inside mctp_bus_rx() (application callback or a control-message reply blocking in mctp_usb_tx()), after which it resumes and calls mctp_pktbuf_free(usb->rx_pkt) on a pointer the teardown has NULLed, dereferencing NULL and faulting on targets with null-pointer detection.

The fix replaces the cancel with k_work_cancel_sync() plus a new struct k_work_sync out_work_sync, so disable waits for the RX worker to finish before draining the FIFO and freeing the packet buffer. The affected code is the MCTP subsystem, which is marked experimental, built only with CONFIG_MCTP_USB.

---

_Free to read at a human pace. An API with keys and an MCP server are in preparation; early access: hello@infrastack.ai_
