All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Yaohan Li" <shunsheng1218@gmail.com>
Cc: virtualization@lists.linux.dev,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Eugenio Perez" <eperezma@redhat.com>
Subject: Re: [PATCH v5] virtio_console: fix buffer ownership and unplug races in the read path
Date: Fri, 13 Nov 2026 09:09:29 +0000	[thread overview]
Message-ID: <sashiko-outbox-212507@kernel.org> (raw)
In-Reply-To: <20261113084952.211929-1-shunsheng1218@gmail.com>

> Two readers can use the same port at once. The read path checks for
> input under inbuf_lock, but fill_readbuf() copies to userspace after the
> lock is released. A second reader can take the same buffer, and the
> input callback can prefetch the next buffer while the first one is still
> in use. This can duplicate data or change its order.
> 
> The read path can also touch the input virtqueue after unplug_port() has
> started tearing it down.
> 
> Let one reader claim port->inbuf while it copies. The claim is published
> under inbuf_lock; other readers wait, and the input callback does not
> prefetch until the claim is released. If the reader does not consume the
> whole buffer, the remainder goes back to port->inbuf before another
> reader can use the next one.
> 
> [ ... ]
> returned -ENODEV, and removing one port left the other port usable.
> CONFIG_CONSOLE_POLL and real remoteproc DMA were not runtime-tested.
> 
> Fixes: 203baab8ba319 ("virtio: console: Introduce function to hand off data from host to readers")
> Signed-off-by: Yaohan Li <shunsheng1218@gmail.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261113084952.211929-1-shunsheng1218@gmail.com?part=1


      reply	other threads:[~2026-11-13  9:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-13  8:49 [PATCH v5] virtio_console: fix buffer ownership and unplug races in the read path Yaohan Li
2026-11-13  9:09 ` sashiko-bot [this message]

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=sashiko-outbox-212507@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=eperezma@redhat.com \
    --cc=mst@redhat.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=shunsheng1218@gmail.com \
    --cc=virtualization@lists.linux.dev \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.