]> 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)
commit59fec4fc61d12ecbfd0ecbe07bc390de00403aae
treed9b73e19efd8a076a8abc4c87608d85eb24dbeee
parenta567104753a93a542a41b35cd12d7b95d0fb191b
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