qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Huth <thuth@redhat.com>
To: Claudio Imbrenda <imbrenda@linux.ibm.com>,
	qemu-devel@nongnu.org, qemu-s390x@nongnu.org
Cc: borntraeger@de.ibm.com, cohuck@redhat.com, frankja@linux.ibm.com
Subject: Re: [PATCH v1 2/2] s390x: Fix SCLP return code when buffer too small
Date: Thu, 26 Sep 2019 14:26:42 +0200	[thread overview]
Message-ID: <c7705acc-7ac7-dbb9-0ff6-0c9c02e59b7c@redhat.com> (raw)
In-Reply-To: <fe2b8d81-f3b9-a752-b6b5-172686780341@redhat.com>

On 26/09/2019 14.20, Thomas Huth wrote:
> On 26/09/2019 13.33, Claudio Imbrenda wrote:
>> Return the correct error code when the SCCB buffer is too small to
>> contain all of the output, for the Read SCP Information and
>> Read CPU Information commands.
>>
>> Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
>> Reviewed-by: Jason J. Herne <jjherne@linux.ibm.com>
>> ---
>>  hw/s390x/sclp.c | 10 ++++++++++
>>  1 file changed, 10 insertions(+)
>>
>> diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c
>> index 76feac8..8f7fe1c 100644
>> --- a/hw/s390x/sclp.c
>> +++ b/hw/s390x/sclp.c
>> @@ -68,6 +68,11 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb)
>>  
>>      read_info->ibc_val = cpu_to_be32(s390_get_ibc_val());
>>  
>> +    if (sccb->h.length < (sizeof(ReadInfo) + cpu_count * sizeof(CPUEntry))) {
> 
> Don't you need a cpu16_to_cpu() around sccb->h.length?

I meant be16_to_cpu(), obviously.

 Thomas


  reply	other threads:[~2019-09-26 12:27 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-26 11:33 [PATCH v1 0/2] s390x: SCLP error cleanup Claudio Imbrenda
2019-09-26 11:33 ` [PATCH v1 1/2] s390x: Add sclp boundary check and fix error priority Claudio Imbrenda
2019-09-26 12:21   ` Thomas Huth
2019-09-27  8:51   ` David Hildenbrand
2019-09-27  9:14     ` Janosch Frank
2019-09-27  9:17       ` David Hildenbrand
2019-09-27  9:20         ` Janosch Frank
2019-09-27  9:29           ` David Hildenbrand
2019-09-26 11:33 ` [PATCH v1 2/2] s390x: Fix SCLP return code when buffer too small Claudio Imbrenda
2019-09-26 12:20   ` Thomas Huth
2019-09-26 12:26     ` Thomas Huth [this message]
2019-09-27  8:37 ` [PATCH v1 0/2] s390x: SCLP error cleanup David Hildenbrand

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=c7705acc-7ac7-dbb9-0ff6-0c9c02e59b7c@redhat.com \
    --to=thuth@redhat.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=imbrenda@linux.ibm.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-s390x@nongnu.org \
    /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;
as well as URLs for NNTP newsgroup(s).