Linux virtualization list
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Jia Jia" <physicalmtea@gmail.com>
Cc: virtualization@lists.linux.dev,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Eugenio Perez" <eperezma@redhat.com>
Subject: Re: [PATCH v2] vhost-scsi: fix page reference leak in misaligned I/O fallback
Date: Fri, 23 Oct 2026 10:48:41 +0000	[thread overview]
Message-ID: <sashiko-outbox-182705@kernel.org> (raw)
In-Reply-To: <20261023104035.6686-1-physicalmtea@gmail.com>

> iov_iter_get_pages2() returns a byte count that excludes the offset into
> the first page, but also returns a reference to that page in pages[].
> 
> On the misaligned-I/O fallback, vhost_scsi_revert_map_iov_to_sgl() puts
> pages already added to the SG list. The cleanup loop starts at
> pages[npages], but accounts for its first page as PAGE_SIZE bytes
> rather than PAGE_SIZE - offset. If the remaining data starts at a
> non-zero offset, it can finish one page early and leave a page reference
> behind.
> 
> Use PAGE_SIZE - offset for the first remaining page and clear offset for
> later pages, as in the mapping loop. Without this, each affected request
> leaks one page reference.
> 
> Fixes: bca939d5bcd0 ("vhost-scsi: Dynamically allocate scatterlists")
> Reviewed-by: Mike Christie <michael.christie@oracle.com>
> Signed-off-by: Jia Jia <physicalmtea@gmail.com>

Sashiko has reviewed this patch and found no issues.

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


      reply	other threads:[~2026-10-23 10:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-23 10:40 [PATCH v2] vhost-scsi: fix page reference leak in misaligned I/O fallback Jia Jia
2026-10-23 10:48 ` 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-182705@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=eperezma@redhat.com \
    --cc=mst@redhat.com \
    --cc=physicalmtea@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox