diff options
author | Arnd Bergmann <arnd@arndb.de> | 2021-03-22 17:02:39 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2021-03-23 00:16:25 +0100 |
commit | e14cfb3bdd0f82147d09e9f46bedda6302f28ee1 (patch) | |
tree | 101a917d41c58ca7fac239718accb6cc36a5715c /arch/x86/kernel/setup.c | |
parent | x86/boot/tboot: Avoid Wstringop-overread-warning (diff) | |
download | linux-e14cfb3bdd0f82147d09e9f46bedda6302f28ee1.tar.xz linux-e14cfb3bdd0f82147d09e9f46bedda6302f28ee1.zip |
x86/boot/compressed: Avoid gcc-11 -Wstringop-overread warning
GCC gets confused by the comparison of a pointer to an integer literal,
with the assumption that this is an offset from a NULL pointer and that
dereferencing it is invalid:
In file included from arch/x86/boot/compressed/misc.c:18:
In function ‘parse_elf’,
inlined from ‘extract_kernel’ at arch/x86/boot/compressed/misc.c:442:2:
arch/x86/boot/compressed/../string.h:15:23: error: ‘__builtin_memcpy’ reading 64 bytes from a region of size 0 [-Werror=stringop-overread]
15 | #define memcpy(d,s,l) __builtin_memcpy(d,s,l)
| ^~~~~~~~~~~~~~~~~~~~~~~
arch/x86/boot/compressed/misc.c:283:9: note: in expansion of macro ‘memcpy’
283 | memcpy(&ehdr, output, sizeof(ehdr));
| ^~~~~~
I could not find any good workaround for this, but as this is only
a warning for a failure during early boot, removing the line entirely
works around the warning.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Martin Sebor <msebor@gmail.com>
Link: https://lore.kernel.org/r/20210322160253.4032422-2-arnd@kernel.org
Diffstat (limited to 'arch/x86/kernel/setup.c')
0 files changed, 0 insertions, 0 deletions