2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00
linux/tools/bootconfig
Ben Hutchings 729dc340a4 bootconfig: Fix negative seeks on 32-bit with LFS enabled
Commit 26dda57695 "tools/bootconfig: Cleanup bootconfig footer size
calculations" replaced some expressions of type int with the
BOOTCONFIG_FOOTER_SIZE macro, which expands to an expression of type
size_t, which is unsigned.

On 32-bit architectures with LFS enabled (i.e. off_t is 64-bit), the
seek offset of -BOOTCONFIG_FOOTER_SIZE now turns into a positive
value.

Fix this by casting the size to off_t before negating it.

Just in case someone changes BOOTCONFIG_MAGIC_LEN to have type size_t
later, do the same thing to the seek offset of -BOOTCONFIG_MAGIC_LEN.

Link: https://lore.kernel.org/all/aKHlevxeg6Y7UQrz@decadent.org.uk/

Fixes: 26dda57695 ("tools/bootconfig: Cleanup bootconfig footer size calculations")
Signed-off-by: Ben Hutchings <benh@debian.org>
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
2025-08-21 08:16:31 +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 negative seeks on 32-bit with LFS enabled 2025-08-21 08:16:31 +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