1
0
Fork 0
mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-01-23 08:35:19 -05:00
linux/arch
Song Liu 65e710899f x86/build: Fix linker fill bytes quirk/incompatibility for ld.lld
With ":text =0xcccc", ld.lld fills unused text area with 0xcccc0000.
Example objdump -D output:

	ffffffff82b04203:       00 00                   add    %al,(%rax)
	ffffffff82b04205:       cc                      int3
	ffffffff82b04206:       cc                      int3
	ffffffff82b04207:       00 00                   add    %al,(%rax)
	ffffffff82b04209:       cc                      int3
	ffffffff82b0420a:       cc                      int3

Replace it with ":text =0xcccccccc", so we get the following instead:

	ffffffff82b04203:       cc                      int3
	ffffffff82b04204:       cc                      int3
	ffffffff82b04205:       cc                      int3
	ffffffff82b04206:       cc                      int3
	ffffffff82b04207:       cc                      int3
	ffffffff82b04208:       cc                      int3

gcc/ld doesn't seem to have the same issue. The generated code stays the
same for gcc/ld.

Signed-off-by: Song Liu <song@kernel.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Reviewed-by: Kees Cook <keescook@chromium.org>
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Fixes: 7705dc8557 ("x86/vmlinux: Use INT3 instead of NOP for linker fill bytes")
Link: https://lore.kernel.org/r/20230906175215.2236033-1-song@kernel.org
2023-09-06 23:49:12 +02:00
..
alpha Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
arc Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
arm Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
arm64 Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
csky Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
hexagon Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
ia64 Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
loongarch Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
m68k Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
microblaze Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
mips Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
nios2 Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
openrisc Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
parisc Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
powerpc Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
riscv Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
s390 Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
sh Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
sparc Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
um Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
x86 x86/build: Fix linker fill bytes quirk/incompatibility for ld.lld 2023-09-06 23:49:12 +02:00
xtensa Add x86 shadow stack support 2023-08-31 12:20:12 -07:00
.gitignore
Kconfig Add x86 shadow stack support 2023-08-31 12:20:12 -07:00