linux/tools/bootconfig
Ben Hutchings 6ed5e20466 bootconfig: Fix unaligned access when building footer
Currently we add padding between the bootconfig text and footer to
ensure that the footer is aligned within the initramfs image.
However, because only the bootconfig data is held in memory, not the
full initramfs image, the footer may not be naturally aligned in
memory.

This can result in an alignment fault (SIGBUS) when writing the footer
on some architectures, such as sparc.

Build the footer in a struct on the stack before adding it to the
buffer.

References: https://buildd.debian.org/status/fetch.php?pkg=linux&arch=sparc64&ver=6.16%7Erc7-1%7Eexp1&stamp=1753209801&raw=0
Link: https://lore.kernel.org/all/aIC-NTw-cdm9ZGFw@decadent.org.uk/

Signed-off-by: Ben Hutchings <benh@debian.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
2025-07-24 22:16:48 +09:00
..
include/linux bootconfig: Cleanup dummy headers in tools/bootconfig 2021-10-10 22:16:02 -04:00
samples tools/bootconfig: Support mixed value and subkey test cases 2021-06-10 13:41:26 -04:00
scripts tools/bootconfig: scripts/ftrace.sh was missing the shebang line, so added it 2025-07-24 00:23:39 +09:00
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
main.c bootconfig: Fix unaligned access when building footer 2025-07-24 22:16:48 +09:00
Makefile tools/bootconfig: specify LDFLAGS as an argument to CC 2025-05-16 11:22:54 +09:00
test-bootconfig.sh tools/bootconfig: Replace some echo with printf for more portability 2025-07-14 11:55:58 +09:00