]> git.baikalelectronics.ru Git - kernel.git/commit
arm64: lds: move special code sections out of kernel exec segment
authorArd Biesheuvel <ardb@kernel.org>
Fri, 29 Apr 2022 13:13:46 +0000 (15:13 +0200)
committerCatalin Marinas <catalin.marinas@arm.com>
Tue, 17 May 2022 08:32:38 +0000 (09:32 +0100)
commitc90a451b1581be969ff3b7899a0c81b9d5a0c850
treed9b73e19efd8a076a8abc4c87608d85eb24dbeee
parent94339395d21c2627269455de297d988acbb5d441
arm64: lds: move special code sections out of kernel exec segment

There are a few code sections that are emitted into the kernel's
executable .text segment simply because they contain code, but are
actually never executed via this mapping, so they can happily live in a
region that gets mapped without executable permissions, reducing the
risk of being gadgetized.

Note that the kexec and hibernate region contents are always copied into
a fresh page, and so there is no need to align them as long as the
overall size of each is below 4 KiB.

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Acked-by: Mark Rutland <mark.rutland@arm.com>
Link: https://lore.kernel.org/r/20220429131347.3621090-2-ardb@kernel.org
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
arch/arm64/kernel/vmlinux.lds.S