From: Mike Christie <michael.christie@oracle.com>
To: Shubham Antil <shubham@octane.security>, virtualization@lists.linux.dev
Cc: "Michael S . Tsirkin" <mst@redhat.com>,
Jason Wang <jasowangio@gmail.com>,
gio@octane.security, stable@vger.kernel.org,
harshit.m.mogalapalli@oracle.com, ilya.okomin@oracle.com
Subject: Re: [PATCH v3] vhost-scsi: zero misaligned I/O bounce pages
Date: Tue, 20 Oct 2026 18:32:06 -0500 [thread overview]
Message-ID: <dfda3096-5d9f-4cb9-a361-efe3911ded09@oracle.com> (raw)
In-Reply-To: <20261020105503.75904-1-shubham@octane.security>
On 10/20/26 5:55 AM, Shubham Antil wrote:
> The misaligned I/O fallback copies the full bounce scatterlist to the
> request buffer during completion. If a data-in command transfers less
> than requested, part of a newly allocated bounce page can remain unwritten.
>
> Allocate bounce pages with __GFP_ZERO so all bytes copied during completion
> have a defined value. This path is already the slow fallback for
> misaligned I/O, so the added initialization cost is acceptable.
>
> Found during an LLM-assisted source audit and validated with a QEMU/KVM
> vhost-scsi target using misaligned data-in commands.
>
> Fixes: 5ced58bfa132 ("vhost-scsi: Fix alignment handling with windows")
> Cc: stable@vger.kernel.org
> Assisted-by: LLM (OpenAI Codex, gpt-5.6-sol)
> Signed-off-by: Shubham Antil <shubham@octane.security>
> ---
> Changes in v3:
> - Restore allocation-time zeroing after review confirmed that this is an
> already slow and uncommon bounce-buffer fallback.
> - Keep the change minimal and document why the zeroing is required.
> - Drop the transfer-length copy-back change from v2.
> - Add the discovery method and the requested Fixes, stable Cc, Assisted-by,
> and Signed-off-by tags.
>
> drivers/vhost/scsi.c | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c
> index 885fac5ed042..8493a372de6c 100644
> --- a/drivers/vhost/scsi.c
> +++ b/drivers/vhost/scsi.c
> @@ -937,7 +937,12 @@ vhost_scsi_copy_iov_to_sgl(struct vhost_scsi_cmd *cmd, struct iov_iter *iter,
> }
>
> for_each_sgtable_sg(sg_table, sg, i) {
> - page = alloc_page(GFP_KERNEL);
> + /*
> + * Completion copies the full bounce buffer, including bytes the
> + * target did not write. This is already the slow fallback for
> + * misaligned I/O, so zeroing is acceptable here.
> + */
> + page = alloc_page(GFP_KERNEL | __GFP_ZERO);
> if (!page) {
> ret = -ENOMEM;
> goto err;
>
Reviewed-by: Mike Christie <michael.christie@oracle.com>
prev parent reply other threads:[~2026-10-20 23:32 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-20 10:55 [PATCH v3] vhost-scsi: zero misaligned I/O bounce pages Shubham Antil
2026-10-20 10:58 ` sashiko-bot
2026-10-20 23:32 ` Mike Christie [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=dfda3096-5d9f-4cb9-a361-efe3911ded09@oracle.com \
--to=michael.christie@oracle.com \
--cc=gio@octane.security \
--cc=harshit.m.mogalapalli@oracle.com \
--cc=ilya.okomin@oracle.com \
--cc=jasowangio@gmail.com \
--cc=mst@redhat.com \
--cc=shubham@octane.security \
--cc=stable@vger.kernel.org \
--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.