PR_PAC_RESET_KEYS
(2const)reset the calling thread's pointer authentication code keys
#include <linux/prctl.h> /* Definition of PR_* constants */ #include <sys/prctl.h> int prctl(PR_PAC_RESET_KEYS, unsigned long keys, 0L, 0L, 0L);
LIBRARY
DESCRIPTION
Securely reset the thread's pointer authentication keys to fresh random values generated by the kernel.
The set of keys to be reset is specified by keys, which must be a logical OR of zero or more of the following:
- PR_PAC_APIAKEY
- instruction authentication key A
- PR_PAC_APIBKEY
- instruction authentication key B
- PR_PAC_APDAKEY
- data authentication key A
- PR_PAC_APDBKEY
- data authentication key B
- PR_PAC_APGAKEY
- generic authentication “A” key.
- (Yes folks, there really is no generic B key.)
As a special case, if keys is zero, then all the keys are reset. Since new keys could be added in future, this is the recommended way to completely wipe the existing keys when establishing a clean execution context.
There is no need to use PR_PAC_RESET_KEYS in preparation for calling execve(2), since execve(2) resets all the pointer authentication keys.
RETURN VALUE
ERRORS
- EINVAL
- keys contains set bits that are invalid or unsupported on this platform.