linux-kernelorg-stable/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
samples
scripts tools/bootconfig: scripts/ftrace.sh was missing the shebang line, so added it 2025-07-24 00:23:39 +09:00
.gitignore
Makefile tools/bootconfig: specify LDFLAGS as an argument to CC 2025-05-16 11:22:54 +09:00
main.c bootconfig: Fix unaligned access when building footer 2025-07-24 22:16:48 +09:00
test-bootconfig.sh tools/bootconfig: Replace some echo with printf for more portability 2025-07-14 11:55:58 +09:00