zipl/boot: Always clear COMMAND_LINE_EXTRA region

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 <mhartmay@linux.ibm.com>
Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Thomas Huth
2021-10-29 11:11:10 +02:00
committed by Jan Höppner
parent e9d1e168b2
commit 10518da618

View File

@@ -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 */