OSDN Git Service

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)
commit6ee3cf6a209fc76d8ae51fba357a62841ec6124c
treed9b73e19efd8a076a8abc4c87608d85eb24dbeee
parentbc5dfb4fd7bd471c77ea48143159eb5e1308d636
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