diff options
| author | Karl Mehltretter <kmehltretter@gmail.com> | 2026-08-18 06:04:33 +0200 |
|---|---|---|
| committer | Michael S. Tsirkin <mst@redhat.com> | 2026-09-04 17:06:04 -0400 |
| commit | 4f68ec264ffb5133406d67a6113e0a8b478a2e91 (patch) | |
| tree | d66a6b4f87869fabfa7cf931d2d6854e71c5da83 /scripts/Makefile.thinlto | |
| parent | 69d4a65c4e926fd2dfd25051416db88aa5ae3a70 (diff) | |
| download | linux-next-4f68ec264ffb5133406d67a6113e0a8b478a2e91.tar.gz linux-next-4f68ec264ffb5133406d67a6113e0a8b478a2e91.zip | |
virtio_input: stop callbacks before unregistering input device
virtinput_remove() unregisters the input device, which can free it,
before resetting the virtio device that can still deliver events.
virtinput_recv_events() drops vi->lock around input_event() and samples
vi->ready only on loop entry. A callback that has passed that check can
therefore use the freed device, requeue a buffer, and kick the queue
after reset has begun.
A KASAN run with the race window widened reproduced the use-after-free.
Reset the device first, as virtinput_freeze() already does. Recheck
vi->ready after reacquiring the lock so the callback does not requeue or
kick once teardown starts.
Fixes: 271c865161c5 ("Add virtio-input driver.")
Assisted-by: Claude:claude-fable-5
Signed-off-by: Karl Mehltretter <kmehltretter@gmail.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Message-ID: <20260818040433.66986-3-kmehltretter@gmail.com>
Diffstat (limited to 'scripts/Makefile.thinlto')
0 files changed, 0 insertions, 0 deletions
