CVE-2026-99313: HID: logitech-hidpp: fix race condition when accessing stale stack pointer
In the Linux kernel, the following vulnerability has been resolved:
HID: logitech-hidpp: fix race condition when accessing stale stack pointer
The driver uses hidpp->sendreceivebuf to point to a stack-allocated buffer in the synchronous command path (dohidppsendmessagesync). However, this pointer is not cleared when the function returns.
If an event is processed (e.g. by a different thread) while the sendmutex is held by a new command, but before that command has updated sendreceivebuf, the handler (hidpprawhidppevent) will observe that the mutex is locked and dereference the stale pointer.
This results in an out-of-bounds access on a different thread's kernel stack (or a NULL pointer dereference on the very first command).
Fix this by: 1. Clearing hidpp->sendreceivebuf to NULL before releasing the mutex in the synchronous command path. 2. Moving the assignment of the local 'question' and 'answer' pointers inside the mutexislocked() block in the handler, and adding a NULL check before dereferencing.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Compensating control
In the Linux kernel Logitech HID++ driver, move the local question and answer pointer assignments inside the mutex_is_locked() block, check for NULL before dereferencing, and clear hidpp->send_receive_buf to NULL before releasing the mutex.
Event History
Frequently Asked Questions
What systems are exposed to this issue?
Systems using the Linux kernel Logitech HID++ driver are exposed when the driver processes HID++ events alongside synchronous commands. The affected condition involves concurrent event handling and command processing in the driver.
What conditions are needed to trigger the flaw?
An HID++ event must be processed by another thread while the synchronous-command mutex is held for a new command, before the new command updates the shared receive-buffer pointer. On the first command, the stale pointer condition can instead result in a NULL pointer dereference.
What can happen if the race is triggered?
The event handler can dereference a stale pointer to another thread's kernel stack, causing an out-of-bounds access. It may also dereference NULL during the first command path.
What does the available fix change?
The fix clears the shared receive-buffer pointer before releasing the mutex in the synchronous command path. It also limits pointer assignment to the locked-handler path and checks for NULL before dereferencing the pointer.