linux-stable/arch/x86
David Gow 005e368a61 arch: um: Mark the stack non-executable to fix a binutils warning
[ Upstream commit bd71558d58 ]

Since binutils 2.39, ld will print a warning if any stack section is
executable, which is the default for stack sections on files without a
.note.GNU-stack section.

This was fixed for x86 in commit ffcf9c5700 ("x86: link vdso and boot with -z noexecstack --no-warn-rwx-segments"),
but remained broken for UML, resulting in several warnings:

/usr/bin/ld: warning: arch/x86/um/vdso/vdso.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: warning: .tmp_vmlinux.kallsyms1 has a LOAD segment with RWX permissions
/usr/bin/ld: warning: .tmp_vmlinux.kallsyms1.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: warning: .tmp_vmlinux.kallsyms2 has a LOAD segment with RWX permissions
/usr/bin/ld: warning: .tmp_vmlinux.kallsyms2.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
/usr/bin/ld: warning: vmlinux has a LOAD segment with RWX permissions

Link both the VDSO and vmlinux with -z noexecstack, fixing the warnings
about .note.GNU-stack sections. In addition, pass --no-warn-rwx-segments
to dodge the remaining warnings about LOAD segments with RWX permissions
in the kallsyms objects. (Note that this flag is apparently not
available on lld, so hide it behind a test for BFD, which is what the
x86 patch does.)

Link: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ffcf9c5700e49c0aee42dcba9a12ba21338e8136
Link: https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=ba951afb99912da01a6e8434126b8fac7aa75107
Signed-off-by: David Gow <davidgow@google.com>
Reviewed-by: Lukas Straub <lukasstraub2@web.de>
Tested-by: Lukas Straub <lukasstraub2@web.de>
Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2022-10-12 09:53:27 +02:00
..
boot x86: link vdso and boot with -z noexecstack --no-warn-rwx-segments 2022-08-17 14:22:45 +02:00
configs x86/kbuild: Enable CONFIG_KALLSYMS_ALL=y in the defconfigs 2022-01-27 11:04:56 +01:00
crypto crypto: blake2s - remove shash module 2022-08-17 14:24:19 +02:00
entry x86/entry: Move CLD to the start of the idtentry macro 2022-08-31 17:16:34 +02:00
events perf/x86/intel/ds: Fix precise store latency handling 2022-08-31 17:16:51 +02:00
hyperv x86/hyperv: Properly deal with empty cpumasks in hyperv_flush_tlb_multi() 2022-03-08 19:12:36 +01:00
ia32 binfmt: remove in-tree usage of MAP_DENYWRITE 2021-09-03 18:42:01 +02:00
include KVM: SEV: add cache flush to solve SEV cache incoherency issues 2022-09-23 14:15:52 +02:00
kernel x86/alternative: Fix race in try_get_desc() 2022-10-05 10:39:44 +02:00
kvm KVM: x86: Hide IA32_PLATFORM_DCA_CAP[31:0] from the guest 2022-10-05 10:39:44 +02:00
lib x86/entry_32: Fix segment exceptions 2022-07-29 17:25:33 +02:00
math-emu x86: Prepare asm files for straight-line-speculation 2022-05-15 20:18:49 +02:00
mm x86/mm: Use proper mask when setting PUD mapping 2022-08-25 11:39:53 +02:00
net x86/extable: Extend extable functionality 2022-07-29 17:25:26 +02:00
pci x86/PCI: Fix ALi M1487 (IBC) PIRQ router link value interpretation 2022-06-09 10:22:46 +02:00
platform x86/olpc: fix 'logical not is only applied to the left hand side' 2022-08-17 14:24:18 +02:00
power x86: Prepare asm files for straight-line-speculation 2022-05-15 20:18:49 +02:00
purgatory kernel.h: split out panic and oops helpers 2021-07-01 11:06:04 -07:00
ras
realmode x86/mm: Flush global TLB when switching to trampoline page-table 2022-01-27 11:04:35 +01:00
tools - Remove cc-option checks which are old and already supported by the 2021-08-30 13:27:16 -07:00
um arch: um: Mark the stack non-executable to fix a binutils warning 2022-10-12 09:53:27 +02:00
video
xen x86/xen: Fix initialisation in hypercall_page after rethunk 2022-07-23 12:54:11 +02:00
.gitignore
Kbuild
Kconfig arch: make TRACE_IRQFLAGS_NMI_SUPPORT generic 2022-08-17 14:23:00 +02:00
Kconfig.assembler
Kconfig.cpu
Kconfig.debug arch: make TRACE_IRQFLAGS_NMI_SUPPORT generic 2022-08-17 14:23:00 +02:00
Makefile x86/realmode: build with -D__DISABLE_EXPORTS 2022-07-23 12:53:56 +02:00
Makefile.um
Makefile_32.cpu x86/build: Do not add -falign flags unconditionally for clang 2021-09-19 10:35:53 +09:00