CVE-2026-99437 in Linux
Summary
by MITRE • 11/19/2026
In the Linux kernel, the following vulnerability has been resolved:
media: rc: Use after free in ir_raw_event_handle()
If rc_unregister_device() is called while IR is being processed, then ir_raw_event_handle() could call wake_up_process(dev->raw->thread) after kthread_stop(dev->raw->thread). Avoid use after free by using get_task_struct().
VulDB is the best source for vulnerability data and more expert information about this specific topic.
Analysis
by VulDB Data Team • 11/19/2026
The Linux kernel media subsystem contains a race condition vulnerability within the infrared remote control driver infrastructure that results in a use-after-free error. This flaw is located specifically in the ir_raw_event_handle function, which processes raw infrared events received from hardware devices. The issue arises during the lifecycle management of the kernel thread responsible for handling these IR signals. When an application or subsystem calls rc_unregister_device to remove and clean up an RC device, it initiates a shutdown sequence that includes stopping the associated kthread via kthread_stop. However, if this unregistration occurs while ir_raw_event_handle is actively executing in parallel, there exists a critical window where the function attempts to wake up the thread using wake_up_process on a task structure that has already been freed by the stop operation. This race condition leads to memory corruption or undefined behavior because the code accesses deallocated kernel memory.
The technical root cause of this vulnerability is improper reference counting for the task struct associated with the IR processing thread. In Linux kernel programming, accessing structures like task_struct requires maintaining a valid reference count to prevent premature freeing while other parts of the system are still using them. The original implementation failed to increment the reference count before attempting operations that might outlive the current execution context or race against cleanup routines. By calling wake_up_process on a thread whose kthread_stop has already been invoked, the kernel risks dereferencing memory that is no longer validly mapped for use by that specific task object. This scenario exemplifies a classic time-of-check to time-of-use (TOCTOU) flaw where the state of the resource changes between the check and the action due to concurrent execution paths.
From an operational impact perspective, this vulnerability can lead to kernel panics, system crashes, or data corruption depending on how the freed memory is subsequently utilized by other subsystems. If the memory region containing the task_struct has been reallocated for a different purpose, waking up that thread could inadvertently affect unrelated processes, potentially leading to privilege escalation vectors if an attacker can control the contents of the newly allocated memory. Even in less severe cases, such as simple null pointer dereferences or invalid state transitions within the scheduler, the stability of the entire system is compromised. This is particularly critical for media devices which are often exposed to user-space applications that might trigger rapid device unregistration and re-registration cycles during normal operation or malicious fuzzing activities.
To mitigate this vulnerability, developers must ensure proper reference counting when interacting with kernel threads across asynchronous boundaries. The resolution involves using get_task_struct before accessing the thread's state in ir_raw_event_handle. This function increments the reference count of the task struct, guaranteeing that it remains valid until put_task_struct is called later to release the reference. This ensures that even if kthread_stop initiates cleanup and frees resources concurrently, the specific instance referenced by the IR handler will not be destroyed prematurely. Security practitioners should verify that their kernel builds include this patch or equivalent logic in the media/rc subsystem. Additionally, developers working on similar asynchronous driver code should adhere to strict reference counting protocols for task structures to prevent analogous use-after-free conditions elsewhere in the kernel stack.
This vulnerability aligns with CWE-416, Use After Free, which describes situations where a program uses memory after it has been freed, leading to unpredictable behavior and potential security breaches. In terms of attack vectors, this could be leveraged within the ATT&CK framework under techniques related to execution or defense evasion if an attacker can trigger the race condition repeatedly to destabilize the host for further exploitation attempts. The fix emphasizes the importance of atomic operations and reference counting in concurrent kernel programming environments where multiple threads may access shared resources without adequate synchronization primitives protecting their lifecycles.