Blame SOURCES/kvm-s390-ipl-fix-off-by-one-in-update_machine_ipl_proper.patch

77c23f
From 1769600e1e3bd5ca48450de8ce8a118bf0af96f3 Mon Sep 17 00:00:00 2001
77c23f
From: Thomas Huth <thuth@redhat.com>
77c23f
Date: Fri, 29 May 2020 05:54:00 -0400
77c23f
Subject: [PATCH 18/42] s390/ipl: fix off-by-one in
77c23f
 update_machine_ipl_properties()
77c23f
MIME-Version: 1.0
77c23f
Content-Type: text/plain; charset=UTF-8
77c23f
Content-Transfer-Encoding: 8bit
77c23f
77c23f
RH-Author: Thomas Huth <thuth@redhat.com>
77c23f
Message-id: <20200529055420.16855-19-thuth@redhat.com>
77c23f
Patchwork-id: 97028
77c23f
O-Subject: [RHEL-8.3.0 qemu-kvm PATCH v2 18/38] s390/ipl: fix off-by-one in update_machine_ipl_properties()
77c23f
Bugzilla: 1828317
77c23f
RH-Acked-by: Claudio Imbrenda <cimbrend@redhat.com>
77c23f
RH-Acked-by: Philippe Mathieu-Daudé <philmd@redhat.com>
77c23f
RH-Acked-by: Cornelia Huck <cohuck@redhat.com>
77c23f
RH-Acked-by: David Hildenbrand <david@redhat.com>
77c23f
77c23f
From: Halil Pasic <pasic@linux.ibm.com>
77c23f
77c23f
In update_machine_ipl_properties() the array ascii_loadparm needs to
77c23f
hold the 8 char loadparm and a string terminating zero char.
77c23f
77c23f
Let's increase the size of ascii_loadparm accordingly.
77c23f
77c23f
Signed-off-by: Halil Pasic <pasic@linux.ibm.com>
77c23f
Fixes: 0a01e082a428 ("s390/ipl: sync back loadparm")
77c23f
Fixes: Coverity CID 1421966
77c23f
Reported-by: Peter Maydell <peter.maydell@linaro.org>
77c23f
Message-Id: <20200320143101.41764-1-pasic@linux.ibm.com>
77c23f
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
77c23f
(cherry picked from commit 7722837369eb1c7e808021d79da68afa0c01c26f)
77c23f
Signed-off-by: Danilo C. L. de Paula <ddepaula@redhat.com>
77c23f
---
77c23f
 hw/s390x/ipl.c | 2 +-
77c23f
 1 file changed, 1 insertion(+), 1 deletion(-)
77c23f
77c23f
diff --git a/hw/s390x/ipl.c b/hw/s390x/ipl.c
77c23f
index f25339c503..fa0409dc23 100644
77c23f
--- a/hw/s390x/ipl.c
77c23f
+++ b/hw/s390x/ipl.c
77c23f
@@ -537,7 +537,7 @@ static void update_machine_ipl_properties(IplParameterBlock *iplb)
77c23f
     /* Sync loadparm */
77c23f
     if (iplb->flags & DIAG308_FLAGS_LP_VALID) {
77c23f
         uint8_t *ebcdic_loadparm = iplb->loadparm;
77c23f
-        char ascii_loadparm[8];
77c23f
+        char ascii_loadparm[9];
77c23f
         int i;
77c23f
 
77c23f
         for (i = 0; i < 8 && ebcdic_loadparm[i]; i++) {
77c23f
-- 
77c23f
2.27.0
77c23f