Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arch/x86_64: Add ARCH_INTEL64_DISABLE_CET #13417

Merged
merged 1 commit into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions arch/x86_64/src/common/Toolchain.defs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ ARCHCPUFLAGS = -fPIC -fno-stack-protector -mno-red-zone -mrdrnd
ARCHPICFLAGS = -fPIC
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef

ifeq ($(CONFIG_ARCH_INTEL64_DISABLE_CET),y)
ARCHOPTIMIZATION += -fcf-protection=none
endif

# We have to use a cross-development toolchain under Cygwin because the native
# Cygwin toolchains don't generate ELF binaries.

Expand Down
9 changes: 9 additions & 0 deletions arch/x86_64/src/intel64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -183,4 +183,13 @@ config ARCH_INTEL64_DISABLE_INT_INIT
controllers. This is necessary if those are already
initialized, i.e. Jailhouse system.

config ARCH_INTEL64_DISABLE_CET
bool "Disable CET completely"
---help---
Intel CET (Control-flow Enforcement Technology) is a hardware
enhancement aimed at mitigating the Retpoline vulnerability.
It inserts the endbr64 instruction at the beginning of functions,
which may impact CPU branch prediction performance.


endif
Loading