Skip to contentSkip to conversation

CVE-2026-97986: virtio_input: stop callbacks before unregistering input device

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Sep 25

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

virtio_input: stop callbacks before unregistering input device

virtinput_remove() unregisters the input device before resetting the virtio device. virtinput_recv_events() drops vi->lock around input_event(), so clearing vi->ready does not stop a callback that passed the entry check. It can still use vi->idev, requeue buffers and kick the queue.

Reset first, as virtinput_freeze() already does. With the preceding core change, reset waits for callbacks before input_unregister_device() can free vi->idev. Recheck vi->ready after taking the lock again: keep draining completed events so an input packet is not truncated, but stop requeueing buffers and kicking the queue.

With evdev attached, input_unregister_handle() currently waits for an RCU grace period, which also waits out IRQ callbacks. This masks the lifetime bug on PCI and MMIO, but does not protect sleepable callbacks on other transports.

The Linux kernel CVE team has assigned CVE-2026-97986 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 4.1 with commit 271c865161c57cfabca45b93eaa712b19da365bc and fixed in 6.12.111 with commit 8226aeee9b9a94cd699fbb51cb230feff46cfaf2
	Issue introduced in 4.1 with commit 271c865161c57cfabca45b93eaa712b19da365bc and fixed in 6.18.53 with commit a3ba86a270dd87460759214046dc7cbd409ac711
	Issue introduced in 4.1 with commit 271c865161c57cfabca45b93eaa712b19da365bc and fixed in 7.2.7 with commit 5378f7945856a5ed88e6f9850bc7a68f54090135
	Issue introduced in 4.1 with commit 271c865161c57cfabca45b93eaa712b19da365bc and fixed in 7.3-rc3 with commit d7808b37da0a619cf1fa541c2384e783fecc2480

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2026-97986

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
drivers/virtio/virtio_input.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/8226aeee9b9a94cd699fbb51cb230feff46cfaf2
	https://git.kernel.org/stable/c/a3ba86a270dd87460759214046dc7cbd409ac711
	https://git.kernel.org/stable/c/5378f7945856a5ed88e6f9850bc7a68f54090135
	https://git.kernel.org/stable/c/d7808b37da0a619cf1fa541c2384e783fecc2480