]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
pc-bios/s390-ccw: fix sclp_get_loadparm_ascii
authorClaudio Imbrenda <imbrenda@linux.ibm.com>
Thu, 28 Nov 2019 12:33:57 +0000 (13:33 +0100)
committerThomas Huth <thuth@redhat.com>
Fri, 29 Nov 2019 08:16:02 +0000 (09:16 +0100)
The existing s390 bios gets the LOADPARM information from the system using
an SCLP call that specifies a buffer length too small to contain all the
output.

The recent fixes in the SCLP code have exposed this bug, since now the
SCLP call will return an error (as per architecture) instead of
writing partially and completing successfully.

The solution is simply to specify the full page length as the SCCB
length instead of a smaller size.

Fixes: 832be0d8a3bb ("s390x: sclp: Report insufficient SCCB length")
Fixes: 9a22473c70f3 ("pc-bios/s390-ccw: get LOADPARM stored in SCP Read Info")
Reported-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Message-Id: <1574944437-31182-1-git-send-email-imbrenda@linux.ibm.com>
Acked-by: Christian Borntraeger <borntraeger@de.ibm.com>
Tested-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Janosch Frank <frankja@linux.ibm.com>
Tested-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
pc-bios/s390-ccw/sclp.c

index c0223fab0bea771147f89cb552c0436b548bd8de..7251f9af4dffbbd17c452336f1facd9be8b4f639 100644 (file)
@@ -112,7 +112,7 @@ void sclp_get_loadparm_ascii(char *loadparm)
     ReadInfo *sccb = (void *)_sccb;
 
     memset((char *)_sccb, 0, sizeof(ReadInfo));
-    sccb->h.length = sizeof(ReadInfo);
+    sccb->h.length = SCCB_SIZE;
     if (!sclp_service_call(SCLP_CMDW_READ_SCP_INFO, sccb)) {
         ebcdic_to_ascii((char *) sccb->loadparm, loadparm, LOADPARM_LEN);
     }