arm64: add __nocfi to functions that jump to a physical address
authorSami Tolvanen <samitolvanen@google.com>
Thu, 8 Apr 2021 18:28:39 +0000 (11:28 -0700)
committerKees Cook <keescook@chromium.org>
Thu, 8 Apr 2021 23:04:22 +0000 (16:04 -0700)
commitcbdac8413e33bd1b9de45eeb10221c4686d743a6
treea77fa0fe9ae124d57881ede5010ebb4eeeb1bf53
parentbde33977bf24b7ed52e2bac0eb9235769a0a11f6
arm64: add __nocfi to functions that jump to a physical address

Disable CFI checking for functions that switch to linear mapping and
make an indirect call to a physical address, since the compiler only
understands virtual addresses and the CFI check for such indirect calls
would always fail.

Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/20210408182843.1754385-15-samitolvanen@google.com
arch/arm64/include/asm/mmu_context.h
arch/arm64/kernel/cpu-reset.h
arch/arm64/kernel/cpufeature.c