arm64: mask PAC bits of __builtin_return_address
This redefines __builtin_return_address to mask pac bits
when Pointer Authentication is enabled. As __builtin_return_address
is used mostly used to refer to the caller function symbol address
so masking runtime generated pac bits will help to find the match.
This patch adds a new file (asm/compiler.h) and is transitively
included (via include/compiler_types.h) on the compiler command line
so it is guaranteed to be loaded and the users of this macro will
not find a wrong version.
A helper macro ptrauth_kernel_pac_mask is created for this purpose
and added in this file. A similar macro ptrauth_user_pac_mask exists
in pointer_auth.h and is now moved here for the sake of consistency.
This change fixes the utilities like cat /proc/vmallocinfo to show
correct symbol names.
Signed-off-by:
Amit Daniel Kachhap <amit.kachhap@arm.com>
Loading
Please register or sign in to comment