Skip to content

Commit 717b938

Browse files
brooniewilldeacon
authored andcommitted
arm64: Document why we enable PAC support for leaf functions
Document the fact that we enable pointer authentication protection for leaf functions since there is some narrow potential for ROP protection benefits and little overhead has been observed. Signed-off-by: Mark Brown <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Will Deacon <[email protected]>
1 parent e515982 commit 717b938

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/arm64/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ branch-prot-flags-y += $(call cc-option,-mbranch-protection=none)
7171

7272
ifeq ($(CONFIG_ARM64_PTR_AUTH),y)
7373
branch-prot-flags-$(CONFIG_CC_HAS_SIGN_RETURN_ADDRESS) := -msign-return-address=all
74+
# We enable additional protection for leaf functions as there is some
75+
# narrow potential for ROP protection benefits and no substantial
76+
# performance impact has been observed.
7477
branch-prot-flags-$(CONFIG_CC_HAS_BRANCH_PROT_PAC_RET) := -mbranch-protection=pac-ret+leaf
7578
# -march=armv8.3-a enables the non-nops instructions for PAC, to avoid the
7679
# compiler to generate them and consequently to break the single image contract

0 commit comments

Comments
 (0)