yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone

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

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