* Re: [PATCH] s390x/sclp: pv: only copy the original SCCB buffer
2026-08-14 12:58 [PATCH] s390x/sclp: pv: only copy the original SCCB buffer Christian Borntraeger
@ 2026-08-14 17:18 ` Eric Farman
2026-08-18 21:07 ` Matthew Rosato
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Eric Farman @ 2026-08-14 17:18 UTC (permalink / raw)
To: Christian Borntraeger, Cornelia Huck
Cc: qemu-devel, qemu-s390x, David Hildenbrand, Richard Henderson,
Janosch Frank, Halil Pasic, Jason Herne, Ilya Leoshkevich,
Matthew Rosato, Christian Borntraeger
On 8/14/26 8:58 AM, Christian Borntraeger wrote:
> From: Christian Borntraeger <borntraeger@linux.ibm.com>
>
> With variable length and EXTENDED_LENGTH_SCCB, some callbacks might
> change the length field. For example read SCP info might write a new
> length into the SCCB header. We must not use that new length for the
> buffer copy, since the buffer was allocated with the original length.
> Only the length field in the work SCCB is changed, to indicate the
> "necessary" size. Using the new length reads past the allocation, so
> tools like ASAN might detect a buffer overrun.
>
> Secure guests do not have EXTENDED_LENGTH_SCCB, and the ultravisor checks
> and sanitizes the length field, so no qemu heap contents are exposed to
> the guest and the non pv-path already has the same header.length.
>
> Fixes: 0f73c5b30b8b ("s390x: protvirt: SCLP interpretation")
> Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> ---
> hw/s390x/sclp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Reviewed-by: Eric Farman <farman@linux.ibm.com>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] s390x/sclp: pv: only copy the original SCCB buffer
2026-08-14 12:58 [PATCH] s390x/sclp: pv: only copy the original SCCB buffer Christian Borntraeger
2026-08-14 17:18 ` Eric Farman
@ 2026-08-18 21:07 ` Matthew Rosato
2026-08-19 11:06 ` Eric Farman
2026-08-27 5:52 ` Michael Tokarev
3 siblings, 0 replies; 6+ messages in thread
From: Matthew Rosato @ 2026-08-18 21:07 UTC (permalink / raw)
To: Christian Borntraeger, Cornelia Huck
Cc: qemu-devel, qemu-s390x, David Hildenbrand, Richard Henderson,
Janosch Frank, Eric Farman, Halil Pasic, Jason Herne,
Ilya Leoshkevich, Christian Borntraeger
On 8/14/26 8:58 AM, Christian Borntraeger wrote:
> From: Christian Borntraeger <borntraeger@linux.ibm.com>
>
> With variable length and EXTENDED_LENGTH_SCCB, some callbacks might
> change the length field. For example read SCP info might write a new
> length into the SCCB header. We must not use that new length for the
> buffer copy, since the buffer was allocated with the original length.
> Only the length field in the work SCCB is changed, to indicate the
> "necessary" size. Using the new length reads past the allocation, so
> tools like ASAN might detect a buffer overrun.
>
> Secure guests do not have EXTENDED_LENGTH_SCCB, and the ultravisor checks
> and sanitizes the length field, so no qemu heap contents are exposed to
> the guest and the non pv-path already has the same header.length.
>
> Fixes: 0f73c5b30b8b ("s390x: protvirt: SCLP interpretation")
> Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] s390x/sclp: pv: only copy the original SCCB buffer
2026-08-14 12:58 [PATCH] s390x/sclp: pv: only copy the original SCCB buffer Christian Borntraeger
2026-08-14 17:18 ` Eric Farman
2026-08-18 21:07 ` Matthew Rosato
@ 2026-08-19 11:06 ` Eric Farman
2026-08-20 6:35 ` Philippe Mathieu-Daudé
2026-08-27 5:52 ` Michael Tokarev
3 siblings, 1 reply; 6+ messages in thread
From: Eric Farman @ 2026-08-19 11:06 UTC (permalink / raw)
To: Christian Borntraeger, Cornelia Huck
Cc: qemu-devel, qemu-s390x, David Hildenbrand, Richard Henderson,
Janosch Frank, Halil Pasic, Jason Herne, Ilya Leoshkevich,
Matthew Rosato, Christian Borntraeger
On 8/14/26 8:58 AM, Christian Borntraeger wrote:
> From: Christian Borntraeger <borntraeger@linux.ibm.com>
>
> With variable length and EXTENDED_LENGTH_SCCB, some callbacks might
> change the length field. For example read SCP info might write a new
> length into the SCCB header. We must not use that new length for the
> buffer copy, since the buffer was allocated with the original length.
> Only the length field in the work SCCB is changed, to indicate the
> "necessary" size. Using the new length reads past the allocation, so
> tools like ASAN might detect a buffer overrun.
>
> Secure guests do not have EXTENDED_LENGTH_SCCB, and the ultravisor checks
> and sanitizes the length field, so no qemu heap contents are exposed to
> the guest and the non pv-path already has the same header.length.
>
> Fixes: 0f73c5b30b8b ("s390x: protvirt: SCLP interpretation")
> Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> ---
> hw/s390x/sclp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Thanks! Applied for 11.2
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] s390x/sclp: pv: only copy the original SCCB buffer
2026-08-19 11:06 ` Eric Farman
@ 2026-08-20 6:35 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 6+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-08-20 6:35 UTC (permalink / raw)
To: Eric Farman, Christian Borntraeger, Cornelia Huck
Cc: qemu-devel, qemu-s390x, David Hildenbrand, Richard Henderson,
Janosch Frank, Halil Pasic, Jason Herne, Ilya Leoshkevich,
Matthew Rosato, Christian Borntraeger
On 19/8/26 13:06, Eric Farman wrote:
>
>
> On 8/14/26 8:58 AM, Christian Borntraeger wrote:
>> From: Christian Borntraeger <borntraeger@linux.ibm.com>
>>
>> With variable length and EXTENDED_LENGTH_SCCB, some callbacks might
>> change the length field. For example read SCP info might write a new
>> length into the SCCB header. We must not use that new length for the
>> buffer copy, since the buffer was allocated with the original length.
>> Only the length field in the work SCCB is changed, to indicate the
>> "necessary" size. Using the new length reads past the allocation, so
>> tools like ASAN might detect a buffer overrun.
>>
>> Secure guests do not have EXTENDED_LENGTH_SCCB, and the ultravisor checks
>> and sanitizes the length field, so no qemu heap contents are exposed to
>> the guest and the non pv-path already has the same header.length.
>>
Cc: qemu-stable@nongnu.org
>> Fixes: 0f73c5b30b8b ("s390x: protvirt: SCLP interpretation")
>> Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
>> ---
>> hw/s390x/sclp.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> Thanks! Applied for 11.2
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] s390x/sclp: pv: only copy the original SCCB buffer
2026-08-14 12:58 [PATCH] s390x/sclp: pv: only copy the original SCCB buffer Christian Borntraeger
` (2 preceding siblings ...)
2026-08-19 11:06 ` Eric Farman
@ 2026-08-27 5:52 ` Michael Tokarev
3 siblings, 0 replies; 6+ messages in thread
From: Michael Tokarev @ 2026-08-27 5:52 UTC (permalink / raw)
To: Christian Borntraeger, Cornelia Huck
Cc: qemu-devel, qemu-s390x, David Hildenbrand, Richard Henderson,
Janosch Frank, Eric Farman, Halil Pasic, Jason Herne,
Ilya Leoshkevich, Matthew Rosato, Christian Borntraeger,
QEMU Stable
On 8/14/26 15:58, Christian Borntraeger wrote:
> From: Christian Borntraeger <borntraeger@linux.ibm.com>
>
> With variable length and EXTENDED_LENGTH_SCCB, some callbacks might
> change the length field. For example read SCP info might write a new
> length into the SCCB header. We must not use that new length for the
> buffer copy, since the buffer was allocated with the original length.
> Only the length field in the work SCCB is changed, to indicate the
> "necessary" size. Using the new length reads past the allocation, so
> tools like ASAN might detect a buffer overrun.
>
> Secure guests do not have EXTENDED_LENGTH_SCCB, and the ultravisor checks
> and sanitizes the length field, so no qemu heap contents are exposed to
> the guest and the non pv-path already has the same header.length.
>
> Fixes: 0f73c5b30b8b ("s390x: protvirt: SCLP interpretation")
> Signed-off-by: Christian Borntraeger <borntraeger@linux.ibm.com>
> ---
> hw/s390x/sclp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
I'm picking this one up for the currently active stable qemu series.
Please let me know if I shouldn't.
Thanks,
/mjt
^ permalink raw reply [flat|nested] 6+ messages in thread