@@ -1481,12 +1481,6 @@ menu "ARMv8.3 architectural features"
14811481config ARM64_PTR_AUTH
14821482 bool "Enable support for pointer authentication"
14831483 default y
1484- depends on (CC_HAS_SIGN_RETURN_ADDRESS || CC_HAS_BRANCH_PROT_PAC_RET) && AS_HAS_PAC
1485- # Modern compilers insert a .note.gnu.property section note for PAC
1486- # which is only understood by binutils starting with version 2.33.1.
1487- depends on LD_IS_LLD || LD_VERSION >= 23301 || (CC_IS_GCC && GCC_VERSION < 90100)
1488- depends on !CC_IS_CLANG || AS_HAS_CFI_NEGATE_RA_STATE
1489- depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS)
14901484 help
14911485 Pointer authentication (part of the ARMv8.3 Extensions) provides
14921486 instructions for signing and authenticating pointers against secret
@@ -1498,13 +1492,6 @@ config ARM64_PTR_AUTH
14981492 for each process at exec() time, with these keys being
14991493 context-switched along with the process.
15001494
1501- If the compiler supports the -mbranch-protection or
1502- -msign-return-address flag (e.g. GCC 7 or later), then this option
1503- will also cause the kernel itself to be compiled with return address
1504- protection. In this case, and if the target hardware is known to
1505- support pointer authentication, then CONFIG_STACKPROTECTOR can be
1506- disabled with minimal loss of protection.
1507-
15081495 The feature is detected at runtime. If the feature is not present in
15091496 hardware it will not be advertised to userspace/KVM guest nor will it
15101497 be enabled.
@@ -1515,6 +1502,24 @@ config ARM64_PTR_AUTH
15151502 but with the feature disabled. On such a system, this option should
15161503 not be selected.
15171504
1505+ config ARM64_PTR_AUTH_KERNEL
1506+ bool
1507+ default y
1508+ depends on ARM64_PTR_AUTH
1509+ depends on (CC_HAS_SIGN_RETURN_ADDRESS || CC_HAS_BRANCH_PROT_PAC_RET) && AS_HAS_PAC
1510+ # Modern compilers insert a .note.gnu.property section note for PAC
1511+ # which is only understood by binutils starting with version 2.33.1.
1512+ depends on LD_IS_LLD || LD_VERSION >= 23301 || (CC_IS_GCC && GCC_VERSION < 90100)
1513+ depends on !CC_IS_CLANG || AS_HAS_CFI_NEGATE_RA_STATE
1514+ depends on (!FUNCTION_GRAPH_TRACER || DYNAMIC_FTRACE_WITH_REGS)
1515+ help
1516+ If the compiler supports the -mbranch-protection or
1517+ -msign-return-address flag (e.g. GCC 7 or later), then this option
1518+ will cause the kernel itself to be compiled with return address
1519+ protection. In this case, and if the target hardware is known to
1520+ support pointer authentication, then CONFIG_STACKPROTECTOR can be
1521+ disabled with minimal loss of protection.
1522+
15181523 This feature works with FUNCTION_GRAPH_TRACER option only if
15191524 DYNAMIC_FTRACE_WITH_REGS is enabled.
15201525
@@ -1606,7 +1611,7 @@ config ARM64_BTI_KERNEL
16061611 bool "Use Branch Target Identification for kernel"
16071612 default y
16081613 depends on ARM64_BTI
1609- depends on ARM64_PTR_AUTH
1614+ depends on ARM64_PTR_AUTH_KERNEL
16101615 depends on CC_HAS_BRANCH_PROT_PAC_RET_BTI
16111616 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94697
16121617 depends on !CC_IS_GCC || GCC_VERSION >= 100100
0 commit comments