CVE-2026-85032

Use-after-free in the MCTP over USB binding when the host disables the class while RX parsing is in progress

Published Nov 3, 2026 CVSS 3.1 · 4.8 Medium EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The MCTP over USB device class splits RX processing between two work items; disabling the class from the host can free the packet buffer while the receiver is still using it. This use‑after‑free allows the device to overwrite heap memory or dereference a NULL pointer, corrupting the MCTP heap or the system heap metadata and typically resulting in a kernel crash or undefined behavior. This vulnerability is a classic CWE‑416 use‑after‑free flaw that can cause denial of service.

Affected Systems

This flaw is limited to Zephyr OS systems that enable the experimental MCTP USB subsystem via CONFIG_MCTP_USB. Any system that runs the USB device stack and processes MCTP frames—particularly those with SMP or preemptible workqueues—will be affected. The issue appears only when a USB host sends partial MCTP frames and then forces a configuration change or bus reset, which triggers the simultaneous running of the RX worker and the disable handler.

Risk and Exploitability

The CVSS score is 4.8, indicating moderate impact. The EPSS score is not available, and the vulnerability is not in CISA KEV, suggesting limited known exploitation. Attackers need physical access to a USB host attached to the device and can trigger the race condition without authentication or user interaction. While the flaw generally causes a crash, it does not provide straightforward remote code execution but may allow an attacker to disrupt services or create a reboot loop if the device restarts after a fault.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Apply the patch that replaces k_work_cancel() with k_work_cancel_sync(), ensuring the RX worker completes before the packet buffer is freed. Dat at commit 277424084e740da5d61a17f40bea3457fa593acc.
  • Update to the latest Zephyr release that incorporates this change.
  • Disable CONFIG_MCTP_USB or remove the MCTP device class if the feature is not required.
  • As a temporary measure, restrict USB host access or enforce a USB host policy that does not issue frequent configuration changes or bus resets.

Generated by OpenCVE AI on November 3, 2026 at 14:36 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Metrics ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'partial'}, 'version': '2.0.3'}

Type Values Removed Values Added
First Time appeared Zephyrproject
Zephyrproject zephyr
Vendors & Products Zephyrproject
Zephyrproject zephyr
Type Values Removed Values Added
Description 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.
Title Use-after-free in the MCTP over USB binding when the host disables the class while RX parsing is in progress
Weaknesses CWE-416
References
Metrics cvssV3_1

{'score': 4.8, 'vector': 'CVSS:3.1/AV:P/AC:H/PR:N/UI:N/S:U/C:N/I:L/A:H'}

Weaknesses

Sources

Status
PUBLISHED
Assigner
zephyr
Published
Updated
Nov 3, 2026, 6:16 PM
Reserved
Sep 2, 2026, 8:23 PM
Status
Awaiting Analysis
Published
Nov 3, 2026, 2:17 PM
Modified
Nov 3, 2026, 7:18 PM