From d978fc6141169348cb2d7dee9b23b7b88bc627c8 Mon Sep 17 00:00:00 2001 From: Marc Hartmayer Date: Tue, 31 Mar 2020 12:16:35 +0200 Subject: [PATCH] boot/ipl.h: remove aligned attribute from `struct ipl_parameter_block` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes an error when genprotimg is compiled with clang and the sanitizers address and undefined behaviour enabled. pv/pv_ipib.c:47:33: runtime error: member access within misaligned address 0x62100000a100 for type 'IplParameterBlock' (aka 'struct ipl_parameter_block'), which requires 4096 byte alignment 0x62100000a100: note: pointer points here 01 00 00 45 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ^ SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior pv/pv_ipib.c:47:33 in This change should be no problem as genprotimg is the only user. Reviewed-by: Philipp Rudo Signed-off-by: Marc Hartmayer Signed-off-by: Jan Höppner --- include/boot/ipl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/boot/ipl.h b/include/boot/ipl.h index f8df98fe..bc9b7fe2 100644 --- a/include/boot/ipl.h +++ b/include/boot/ipl.h @@ -129,7 +129,7 @@ struct ipl_parameter_block { struct ipl_pb0_pv pv; char raw[PAGE_SIZE - sizeof(struct ipl_pl_hdr)]; }; -} __packed __aligned(PAGE_SIZE); +} __packed; /* IPL Report List header */ struct ipl_rl_hdr {