From: "Michael S. Tsirkin" <mst@redhat.com>
To: Xiong Weimin <xiongweimin@kylinos.cn>
Cc: virtualization@lists.linux.dev, linux-kernel@vger.kernel.org,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Jason Wang" <jasowangio@gmail.com>,
"Jason Wang" <jasowang@redhat.com>,
"Xuan Zhuo" <xuanzhuo@linux.alibaba.com>,
"Eugenio Pérez" <eperezma@redhat.com>,
stable@vger.kernel.org
Subject: Re: [PATCH] virtio_input: reset device if input_register_device() fails
Date: Wed, 5 Aug 2026 01:29:28 -0400 [thread overview]
Message-ID: <20260805012846-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20260805032931.1606652-1-xiongweimin@kylinos.cn>
On Wed, Aug 05, 2026 at 11:29:31AM +0800, Xiong Weimin wrote:
> Probe marks the device DRIVER_OK with virtio_device_ready() before
> calling input_register_device(). If registration fails, the error path
> cleared vi->ready and called del_vqs() while the device was still live,
> so the device could keep DMA to queues that were already torn down.
>
> Match remove/freeze: call virtio_reset_device() on that path before
> tearing down the virtqueues.
>
> Fixes: 271c865161c5 ("Add virtio-input driver.")
> Cc: stable@vger.kernel.org
for each of these patches: is this a real or a theoretical issue?
stable rules preclude the later kind.
> Signed-off-by: Xiong Weimin <xiongweimin@kylinos.cn>
> ---
> drivers/virtio/virtio_input.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/virtio/virtio_input.c b/drivers/virtio/virtio_input.c
> index deec24e8e..1a87be4c8 100644
> --- a/drivers/virtio/virtio_input.c
> +++ b/drivers/virtio/virtio_input.c
> @@ -331,6 +331,7 @@ static int virtinput_probe(struct virtio_device *vdev)
> spin_lock_irqsave(&vi->lock, flags);
> vi->ready = false;
> spin_unlock_irqrestore(&vi->lock, flags);
> + virtio_reset_device(vdev);
> err_mt_init_slots:
> input_free_device(vi->idev);
> err_input_alloc:
> --
> 2.43.0
next prev parent reply other threads:[~2026-08-05 5:29 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-05 3:29 [PATCH] virtio_input: reset device if input_register_device() fails Xiong Weimin
2026-08-05 5:29 ` Michael S. Tsirkin [this message]
2026-08-05 6:19 ` Xiong Weimin
2026-08-05 6:47 ` Xiong Weimin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260805012846-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=eperezma@redhat.com \
--cc=jasowang@redhat.com \
--cc=jasowangio@gmail.com \
--cc=kraxel@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=virtualization@lists.linux.dev \
--cc=xiongweimin@kylinos.cn \
--cc=xuanzhuo@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox