From: "Michael S. Tsirkin" <mst@redhat.com>
To: sungbyeongchan <tjdqudcks0424@naver.com>
Cc: "James E . J . Bottomley" <James.Bottomley@hansenpartnership.com>,
"Martin K . Petersen" <mkp@kernel.org>,
Jason Wang <jasowangio@gmail.com>,
linux-scsi@vger.kernel.org, virtualization@lists.linux.dev,
linux-kernel@vger.kernel.org, security@kernel.org
Subject: Re: [BUG] scsi: short virtio-scsi VPD response exposes stale heap data
Date: Tue, 6 Oct 2026 05:25:46 -0400 [thread overview]
Message-ID: <20261006052300-mutt-send-email-mst@kernel.org> (raw)
In-Reply-To: <20261006091138.827988-1-tjdqudcks0424@naver.com>
On Tue, Oct 06, 2026 at 06:11:36PM +0900, sungbyeongchan wrote:
> Hello,
>
> I found a stale heap information disclosure in the SCSI VPD cache path
> when a virtio-scsi backend completes a short data-in response as
> successful.
>
> The backend first declares a 256-byte VPD page, then writes only the
> four-byte VPD header. virtscsi_vq_done() obtains the used length from
> virtqueue_get_buf(), but that length is not propagated to
> virtscsi_complete_cmd(). With good status and resid=0, the SCSI core
> accepts the device-declared page size. scsi_get_vpd_buf() allocates the
> cache with kmalloc(), and the mode-0444 vpd_pg80 sysfs attribute later
> copies the unwritten tail to an unprivileged reader.
>
> I reproduced this twice on commit
> ff47652a4b66c067c765a7ad464d930b5a9367cc with a local
> vhost-user-scsi backend. In both runs, uid 65534 read 252 stale bytes
> from a reused same-size heap object after the four valid VPD bytes. A
> normal full response returned only its valid data. Reporting the short
> transfer through resid prevented the stale marker from being returned.
>
> The demonstrated impact is a bounded guest-kernel heap disclosure to an
> unprivileged sysfs reader. I did not demonstrate arbitrary read/write,
> code execution, host compromise, guest escape, or privilege escalation.
>
> As a minimal disclosure mitigation I tested changing the cached VPD
> allocation to kzalloc(). The malicious fixed A/B returned a zero tail,
> and the normal VPD control was unchanged. This mitigation prevents the
> disclosure but does not make virtio-scsi reject every inconsistent
> used-length/residual pair; maintainers may prefer to propagate and
> validate the actual transfer length instead.
>
> I performed a best-effort public duplicate search through 2026-10-06
> and found no exact public report for this short virtio-scsi VPD response
> and sysfs disclosure path.
>
> This report was prepared with AI assistance and is being treated as
> public under Documentation/process/security-bugs.rst. A tested source
> reproducer, backend, logs, configuration, and proposed mitigation are
> available to the maintainers on request; the reproducer is intentionally
> not attached to this public report.
>
> Assisted-by: LLM
>
> Regards,
> sungbyeongchan
So a broken device makes guest kernel leak some uninitialized heap
data to guest userspace? Is that a fair summary?
--
MST
next prev parent reply other threads:[~2026-10-06 9:25 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-06 9:11 sungbyeongchan
2026-10-06 9:25 ` Michael S. Tsirkin [this message]
2026-10-06 9:40 ` 성병찬
2026-10-06 9:49 ` Michael S. Tsirkin
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=20261006052300-mutt-send-email-mst@kernel.org \
--to=mst@redhat.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=jasowangio@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mkp@kernel.org \
--cc=security@kernel.org \
--cc=tjdqudcks0424@naver.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®