Skip to content

Commit 67dfd72

Browse files
samitolvanenkees
authored andcommitted
KVM: arm64: Disable CFI for nVHE
Disable CFI for the nVHE code to avoid address space confusion. 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-18-samitolvanen@google.com
1 parent 800618f commit 67dfd72

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

arch/arm64/kvm/hyp/nvhe/Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,9 @@ quiet_cmd_hyprel = HYPREL $@
7575
quiet_cmd_hypcopy = HYPCOPY $@
7676
cmd_hypcopy = $(OBJCOPY) --prefix-symbols=__kvm_nvhe_ $< $@
7777

78-
# Remove ftrace and Shadow Call Stack CFLAGS.
79-
# This is equivalent to the 'notrace' and '__noscs' annotations.
80-
KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS), $(KBUILD_CFLAGS))
78+
# Remove ftrace, Shadow Call Stack, and CFI CFLAGS.
79+
# This is equivalent to the 'notrace', '__noscs', and '__nocfi' annotations.
80+
KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_FTRACE) $(CC_FLAGS_SCS) $(CC_FLAGS_CFI), $(KBUILD_CFLAGS))
8181

8282
# KVM nVHE code is run at a different exception code with a different map, so
8383
# compiler instrumentation that inserts callbacks or checks into the code may

0 commit comments

Comments
 (0)