From: Matthew Rosato <mjrosato@linux.ibm.com>
To: Christian Borntraeger <borntraeger@linux.ibm.com>,
Cornelia Huck <cohuck@redhat.com>
Cc: qemu-devel <qemu-devel@nongnu.org>,
qemu-s390x <qemu-s390x@nongnu.org>,
"Halil Pasic" <pasic@linux.ibm.com>,
"Eric Farman" <farman@linux.ibm.com>,
"Jason Herne" <jjherne@linux.ibm.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Ilya Leoshkevich" <iii@linux.ibm.com>,
"David Hildenbrand" <david@kernel.org>,
"Hendrik Brueckner" <brueckner@linux.ibm.com>,
"Joshua Daley" <jdaley@linux.ibm.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Jared Rossi" <jrossi@linux.ibm.com>,
"Zhuoying Cai" <zycai@linux.ibm.com>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>
Subject: Re: [PATCH 2/5] s390x/ipl: validate num_comp against iplb length before iterating
Date: Mon, 27 Jul 2026 11:04:13 -0400 [thread overview]
Message-ID: <2ad0edd9-4e63-4edf-b036-ad9ed618d02b@linux.ibm.com> (raw)
In-Reply-To: <20260727115052.24289-3-borntraeger@linux.ibm.com>
On 7/27/26 7:50 AM, Christian Borntraeger wrote:
> From: Joshua Daley <jdaley@linux.ibm.com>
>
> In ipl_valid_pv_components(), the upper bound of the for loop,
> ipib_pv->num_comp, is read from guest memory. Before iterating, verify
> that its value will not cause a read beyond the end of the
> IplParameterBlock.
>
> Fixes: c3347ed0d2ee42a7 ("s390x: protvirt: Support unpack facility")
> Signed-off-by: Joshua Daley <jdaley@linux.ibm.com>
> Reviewed-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
> ---
> hw/s390x/ipl.h | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h
> index fac30763df..ef9c063d90 100644
> --- a/hw/s390x/ipl.h
> +++ b/hw/s390x/ipl.h
> @@ -124,6 +124,12 @@ static inline bool ipl_valid_pv_components(IplParameterBlock *iplb)
> return false;
> }
>
> + if (offsetof(IplParameterBlock, pv.components) +
> + ipib_pv->num_comp * sizeof(IPLBlockPVComp) >
> + be32_to_cpu(iplb->len)) {
> + return false;
> + }
> +
> for (i = 0; i < ipib_pv->num_comp; i++) {
> /* Addr must be 4k aligned */
> if (ipib_pv->components[i].addr & ~TARGET_PAGE_MASK) {
next prev parent reply other threads:[~2026-07-27 15:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 11:50 [PATCH 0/5] more hardening fixes for s390 Christian Borntraeger
2026-07-27 11:50 ` [PATCH 1/5] hw/char/sclpconsole-lm: avoid guest triggerable assert Christian Borntraeger
2026-07-27 14:46 ` Matthew Rosato
2026-07-27 11:50 ` [PATCH 2/5] s390x/ipl: validate num_comp against iplb length before iterating Christian Borntraeger
2026-07-27 15:04 ` Matthew Rosato [this message]
2026-07-27 11:50 ` [PATCH 3/5] pc-bios/s390-ccw: fix out-of-bounds read in iso_get_file_size() Christian Borntraeger
2026-07-27 15:18 ` Matthew Rosato
2026-07-27 11:50 ` [PATCH 4/5] pc-bios/s390-ccw: bounds-check zipl menu entry index before array write Christian Borntraeger
2026-07-27 15:32 ` Matthew Rosato
2026-07-27 11:50 ` [PATCH 5/5] pc-bios/s390-ccw: bound zipl menu strlen and replace VLA in zipl_print_entry Christian Borntraeger
2026-07-27 15:51 ` Matthew Rosato
2026-07-27 16:02 ` Matthew Rosato
2026-07-27 17:32 ` Joshua Daley
2026-07-27 20:02 ` Eric Farman
2026-07-27 12:00 ` [PATCH 0/5] more hardening fixes for s390 Eric Farman
2026-07-27 12:14 ` Cornelia Huck
2026-07-27 12:17 ` Christian Borntraeger
2026-07-27 15:06 ` Cornelia Huck
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=2ad0edd9-4e63-4edf-b036-ad9ed618d02b@linux.ibm.com \
--to=mjrosato@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=brueckner@linux.ibm.com \
--cc=cohuck@redhat.com \
--cc=david@kernel.org \
--cc=farman@linux.ibm.com \
--cc=iii@linux.ibm.com \
--cc=jdaley@linux.ibm.com \
--cc=jjherne@linux.ibm.com \
--cc=jrossi@linux.ibm.com \
--cc=marcandre.lureau@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=zycai@linux.ibm.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 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.