Debian Codegraph @

upstream/debian-unstable/man2/PR_PAC_RESET_KEYS.2const

raw
1 .\" Copyright 2020, Michael Kerrisk <[email protected]>
2 .\" Copyright, the authors of the Linux man-pages project
3 .\"
4 .\" SPDX-License-Identifier: Linux-man-pages-copyleft
5 .\"
6 .TH PR_PAC_RESET_KEYS 2const 2026-02-08 "Linux man-pages 6.18"
7 .SH NAME
8 PR_PAC_RESET_KEYS
9 \-
10 reset the calling thread's pointer authentication code keys
11 .SH LIBRARY
12 Standard C library
13 .RI ( libc ,\~ \-lc )
14 .SH SYNOPSIS
15 .nf
16 .BR "#include <linux/prctl.h>" " /* Definition of " PR_* " constants */"
17 .B #include <sys/prctl.h>
18 .P
19 .BI "int prctl(PR_PAC_RESET_KEYS, unsigned long " keys ", 0L, 0L, 0L);"
20 .fi
21 .SH DESCRIPTION
22 Securely reset the thread's pointer authentication keys
23 to fresh random values generated by the kernel.
24 .P
25 The set of keys to be reset is specified by
26 .IR keys ,
27 which must be a logical OR of zero or more of the following:
28 .TP
29 .B PR_PAC_APIAKEY
30 instruction authentication key A
31 .TP
32 .B PR_PAC_APIBKEY
33 instruction authentication key B
34 .TP
35 .B PR_PAC_APDAKEY
36 data authentication key A
37 .TP
38 .B PR_PAC_APDBKEY
39 data authentication key B
40 .TP
41 .B PR_PAC_APGAKEY
42 generic authentication \[lq]A\[rq] key.
43 .IP
44 (Yes folks, there really is no generic B key.)
45 .P
46 As a special case, if
47 .I keys
48 is zero, then all the keys are reset.
49 Since new keys could be added in future,
50 this is the recommended way to completely wipe the existing keys
51 when establishing a clean execution context.
52 .P
53 There is no need to use
54 .B PR_PAC_RESET_KEYS
55 in preparation for calling
56 .BR execve (2),
57 since
58 .BR execve (2)
59 resets all the pointer authentication keys.
60 .SH RETURN VALUE
61 On success,
62 0 is returned.
63 On error, \-1 is returned, and
64 .I errno
65 is set to indicate the error.
66 .SH ERRORS
67 .TP
68 .B EINVAL
69 .I keys
70 contains set bits that are invalid or unsupported on this platform.
71 .SH STANDARDS
72 Linux.
73 arm64 only.
74 .SH HISTORY
75 Linux 5.0 (arm64).
76 .\" commit ba830885656414101b2f8ca88786524d4bb5e8c1
77 .SH CAVEATS
78 Because the compiler or run-time environment
79 may be using some or all of the keys,
80 a successful
81 .B PR_PAC_RESET_KEYS
82 may crash the calling process.
83 The conditions for using it safely are complex and system-dependent.
84 Don't use it unless you know what you are doing.
85 .SH SEE ALSO
86 .BR prctl (2)
87 .P
88 For more information, see the kernel source file
89 .IR Documentation/arch/arm64/pointer\-authentication.rst .