Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB
CVE-2026-97986 Overview
CVE-2026-97986 affects the Linux kernel's virtio_input driver. The virtinput_remove() function unregisters the input device before resetting the virtio device, creating a window where in-flight callbacks can still access freed resources. The virtinput_recv_events() function drops vi->lock around input_event(), which means clearing vi->ready does not stop callbacks that have already passed the entry check. Those callbacks can continue to use vi->idev, requeue buffers, and kick the queue after the input device has been freed.
Critical Impact
A race between device removal and virtio callback execution can lead to use-after-free of vi->idev, potentially causing kernel memory corruption or denial of service on systems using virtio_input devices.
Affected Products
- Linux kernel versions containing the pre-patch virtio_input driver
- Virtualized guests exposing virtio_input devices over PCI, MMIO, or other virtio transports
- Linux distributions shipping affected mainline kernel versions prior to the referenced fix commits
Discovery Timeline
- 2026-09-25 - CVE-2026-97986 published to the National Vulnerability Database (NVD)
- 2026-09-25 - Last updated in NVD database
Technical Details for CVE-2026-97986
Vulnerability Analysis
The flaw is a lifetime management bug in the virtio_input driver's removal path. During virtinput_remove(), the driver calls input_unregister_device() before resetting the underlying virtio device. Because virtinput_recv_events() releases vi->lock while calling input_event(), any callback already past the vi->ready check can continue executing. That callback holds and dereferences vi->idev, which the unregister path may have already freed.
The fix reorders the shutdown sequence to mirror virtinput_freeze(): reset the virtio device first so that reset waits for callbacks to complete before input_unregister_device() releases vi->idev. The patch also rechecks vi->ready after re-acquiring the lock, allowing completed events to drain without truncation while blocking any further buffer requeue or queue kicks.
Root Cause
The root cause is a use-after-free condition driven by incorrect teardown ordering combined with lock-dropping inside the receive callback. The vi->ready flag is not a sufficient barrier because callbacks sample it before releasing the lock, then operate on vi->idev after the lock is dropped. With evdev attached, input_unregister_handle() waits for an RCU grace period, which incidentally serializes IRQ-driven callbacks and masks the lifetime bug on PCI and MMIO transports. That protection does not extend to sleepable callbacks on other virtio transports, exposing the race.
Attack Vector
Triggering the race requires device removal or hot-unplug of a virtio_input device while event delivery is in progress. In virtualization scenarios, this can occur during guest reconfiguration, device detach by the hypervisor, or driver unload. A local actor with the ability to influence device detach timing, or a malicious or buggy host-side implementation that drives events while removal races, could induce the use-after-free. No verified public exploit is referenced in the advisory data.
No verified exploitation code is available for this vulnerability. See the upstream patches for the authoritative fix: Linux Kernel Commit 5378f79, Linux Kernel Commit 8226aee, Linux Kernel Commit a3ba86a, and Linux Kernel Commit d7808b3.
Detection Methods for CVE-2026-97986
Indicators of Compromise
- Kernel oops or panic messages referencing virtinput_recv_events, input_event, or virtio_input during device removal or hot-unplug
- KASAN use-after-free reports pointing to vi->idev or input device structures in virtio_input teardown paths
- Unexpected guest crashes correlated with virtio_input device detach events on the hypervisor
Detection Strategies
- Enable KASAN and lockdep on test kernels to surface the use-after-free and ordering violations during virtio_input stress testing
- Audit running kernels against the fixed commits (5378f79, 8226aee, a3ba86a, d7808b3) to confirm the patch is present
- Monitor dmesg and system journals on virtualized hosts for virtio_input stack traces following device removal
Monitoring Recommendations
- Centralize kernel log collection from virtualized Linux guests and alert on virtio_input-related oops entries
- Track kernel package versions across the fleet and flag hosts running pre-patch versions of the virtio_input driver
- Correlate hypervisor-side virtio_input hot-unplug events with guest-side kernel errors for faster triage
How to Mitigate CVE-2026-97986
Immediate Actions Required
- Apply the upstream Linux kernel patches referenced in the advisory to all affected systems
- Prioritize patching on virtualized Linux guests that expose virtio_input devices, especially where hot-unplug is used operationally
- Where patching is delayed, avoid runtime removal or hot-unplug of virtio_input devices on production guests
Patch Information
The fix is distributed across the following upstream commits in the Linux stable tree: Linux Kernel Commit 5378f79, Linux Kernel Commit 8226aee, Linux Kernel Commit a3ba86a, and Linux Kernel Commit d7808b3. The patches reorder virtinput_remove() to reset the virtio device before unregistering the input device and recheck vi->ready after reacquiring vi->lock to safely drain completed events.
Workarounds
- Unload the virtio_input module on guests that do not require virtio input devices
- Avoid dynamic detach of virtio_input devices from running guests until the kernel is patched
- Restrict hypervisor-side operations that trigger virtio_input hot-unplug to maintenance windows
# Verify virtio_input module status and kernel version on affected guests
uname -r
lsmod | grep virtio_input
# If virtio_input is not required, prevent it from loading
echo 'blacklist virtio_input' | sudo tee /etc/modprobe.d/blacklist-virtio-input.conf
sudo update-initramfs -u
Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.
Sources: National Vulnerability Database, CISA KEV, Exploit-DB

