GHSA-xr9m-8j99-rw4m: Module Manager passes an unvalidated tx_trace_buffer_full_notify callback to the kernel, which invokes it in privileged context

GHSA ID

GHSA‑xr9m‑8j99‑rw4m

CVE ID

CVE‑2026‑102710

Severity

High

CWE

CWE-269, CWE-822

Published

2026‑11‑01

Last updated

2026‑11‑01

Affected packages

Package Vulnerable versions Patched versions

ThreadX

>= 6.0.1, ⇐ 6.5.2.202603

6.5.2.202603b

Description

Summary

A user-mode, memory-protected module can register any function pointer as ThreadX’s global trace-buffer-full callback through tx_trace_buffer_full_notify. The kernel stores the pointer and calls it directly, from privileged code, whenever the trace buffer wraps. A pointer into the module’s own code therefore runs with kernel privilege, defeating the Module Manager’s isolation; an invalid pointer faults the kernel.

Details

_txm_module_manager_tx_trace_buffer_full_notify_dispatch forwards the module’s pointer to _tx_trace_buffer_full_notify without any check. _tx_trace_buffer_full_notify stores it in _tx_trace_full_notify_function, and TX_TRACE_IN_LINE_INSERT calls that function directly each time the trace buffer wraps, in whatever privileged context inserted the event.

Every other module callback path protects the kernel from this. The per-object notification services (tx_semaphore_put_notify, tx_queue_send_notify, tx_event_flags_set_notify, tx_thread_entry_exit_notify and timer creation) store the module’s function and hand the kernel a Module Manager trampoline, so the module’s function later runs on the module’s own callback thread. The other global callback, tx_thread_stack_error_notify, refuses user-mode modules outright. tx_trace_buffer_full_notify was the only module callback service with neither protection, and its dispatcher is compiled in by default.

A user-mode module cannot enable tracing itself, since that dispatcher is gated, but once the resident application has enabled tracing the module can register its callback and insert user events with tx_trace_user_event_insert until the buffer wraps.

Impact

A module loaded with TXM_MODULE_USER_MODE | TXM_MODULE_MEMORY_PROTECTION executes its own code with kernel privilege: on Cortex-M the reporter measured CONTROL.nPRIV = 0 inside the module’s callback, which then has the access of the kernel. A module that registers an invalid pointer instead faults the kernel each time the buffer wraps, until the system is reset.

Affected configurations

Systems that use the Module Manager on any module port, build ThreadX with TX_ENABLE_EVENT_TRACE, enable tracing at run time, and load a user-mode module an attacker controls. TX_ENABLE_EVENT_TRACE is the build option for TraceX, the project’s own trace tooling, and is used in production builds that keep trace capture for field diagnostics.

Affected versions: [6.0.1, 6.5.2.202603]. 6.0.1 is the first release with the Module Manager.

Severity

CVSS:4.0/AV:L/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N, CVSS-B 8.5 (High). CWE-269: Improper Privilege Management; CWE-822: Untrusted Pointer Dereference.

The attacker is the author of a module the device loads. The module, the Module Manager and the kernel are one firmware image under one security authority, so the escape is scored as an impact on the vulnerable system, as for the other Module Manager escalations this project has published.

Patches

Fixed in ThreadX 6.5.2.202603b. The dispatcher now refuses user-mode modules with TXM_MODULE_INVALID_PROPERTIES, for a null pointer as well as a function, as tx_thread_stack_error_notify does; privileged modules register as before. This is the fix the reporter suggested. A new regression test drives the dispatcher with user-mode and privileged modules and fails without the fix.

Workarounds

Build without TX_ENABLE_EVENT_TRACE, or do not enable tracing at run time, on systems that load untrusted modules. Alternatively, define TXM_TRACE_BUFFER_FULL_NOTIFY_CALL_NOT_USED when building the Module Manager to remove the service from the dispatch table.

Credits

Reported by SounLabs (@SounLabs). Fixed by Frédéric Desbiens.

The fix and regression test were produced with AI assistance under human review, in accordance with the Eclipse Foundation’s Generative AI Usage Guidelines.