From 10518da61810a52bcc4af74dd9ef110686b70dba Mon Sep 17 00:00:00 2001 From: Thomas Huth Date: Fri, 29 Oct 2021 11:11:10 +0200 Subject: [PATCH] zipl/boot: Always clear COMMAND_LINE_EXTRA region MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Always clear the COMMAND_LINE_EXTRA region, also in case sclp_setup() fails. If the region is not cleared properly, there might be junk in there after a reboot, causing confusion for the kernel later. While we're at it, also switch to COMMAND_LINE_EXTRA_SIZE instead of COMMAND_LINE_SIZE, since that constant is more appropriate here. Closes: https://github.com/ibm-s390-linux/s390-tools/pull/122 Reviewed-by: Marc Hartmayer Signed-off-by: Thomas Huth Signed-off-by: Jan Höppner --- zipl/boot/menu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zipl/boot/menu.c b/zipl/boot/menu.c index 1e40c088..ad0837f3 100644 --- a/zipl/boot/menu.c +++ b/zipl/boot/menu.c @@ -143,12 +143,13 @@ int menu(void) int rc; cmd_line_extra = (char *)COMMAND_LINE_EXTRA; + memset(cmd_line_extra, 0, COMMAND_LINE_EXTRA_SIZE); + rc = sclp_setup(SCLP_INIT); if (rc) /* sclp setup failed boot default */ goto boot; - memset(cmd_line_extra, 0, COMMAND_LINE_SIZE); rc = menu_param(&value); if (rc == 0) { /* got number from loadparm, boot it */