From fcfee1aa84d3d3afef6a30b3657b2a2ea99edfce Mon Sep 17 00:00:00 2001 From: Eduard Shishkin Date: Mon, 16 Mar 2026 17:31:33 +0100 Subject: [PATCH] zipl/src: Fix a bug in building replicated program tables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When installing IPL on mirrored targets, zipl builds multiple program tables (one such table per each mirror). If the option "--add-files" was specified, then zipl uses the in-bootmap files, that was written at the prevoius iteration (for the mirror ID #0) to build program tables for mirrors with ID #1 (and larger). The in-bootmap files already don't contain trailers. Despite this, the building process cuts off the tail of trailer size, which results in corrupted boot data. This bug may result in crashing the kernel when booting from mirrors with ID #1 (and larger) and manifests only if the boot components are signed and the option "--add-files" is specified for the installation session. Don't count the trailer, when building program tables using in-bootmap files written at the previous iteration. Fixes: 431e4542ca9c ("zipl/src: Reuse data of file components in bootmap") Signed-off-by: Eduard Shishkin Reviewed-by: Jan Höppner Signed-off-by: Jan Höppner --- zipl/src/bootmap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zipl/src/bootmap.c b/zipl/src/bootmap.c index 7d75b608..14a30c34 100644 --- a/zipl/src/bootmap.c +++ b/zipl/src/bootmap.c @@ -441,12 +441,14 @@ static int add_component_file(struct install_set *bis, const char *filename, if (add_files && comp_reg->offset > 0) { /* - * The file has been already written to the bootmap. + * The file has been already written to the bootmap, + * and that in-bootmap file doesn't contain a trailer. * Use the respective region in the bootmap file to * add the component */ filename = bis->filename; add_files = 0; + trailer = 0; } else { comp_reg = NULL; }