arm64: Document why we enable PAC support for leaf functions
authorMark Brown <broonie@kernel.org>
Wed, 6 May 2020 19:51:28 +0000 (20:51 +0100)
committerWill Deacon <will@kernel.org>
Thu, 7 May 2020 16:53:20 +0000 (17:53 +0100)
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 <broonie@kernel.org>
Link: https://lore.kernel.org/r/20200506195138.22086-2-broonie@kernel.org
Signed-off-by: Will Deacon <will@kernel.org>
arch/arm64/Makefile

index 85e4149cc5d5c142d20b2924d3e10f31cf2a240d..921c8ee8552b700195319f0aa143c88ea59541a5 100644 (file)
@@ -71,6 +71,9 @@ branch-prot-flags-y += $(call cc-option,-mbranch-protection=none)
 
 ifeq ($(CONFIG_ARM64_PTR_AUTH),y)
 branch-prot-flags-$(CONFIG_CC_HAS_SIGN_RETURN_ADDRESS) := -msign-return-address=all
+# We enable additional protection for leaf functions as there is some
+# narrow potential for ROP protection benefits and no substantial
+# performance impact has been observed.
 branch-prot-flags-$(CONFIG_CC_HAS_BRANCH_PROT_PAC_RET) := -mbranch-protection=pac-ret+leaf
 # -march=armv8.3-a enables the non-nops instructions for PAC, to avoid the
 # compiler to generate them and consequently to break the single image contract