PR_PAC_RESET_KEYS(2const)
π PR_PAC_RESET_KEYS β ok bestie, let's talk pointer auth keys
So like, this is the PR_PAC_RESET_KEYS(2const) page, aka the little corner of prctl(2) that handles pointer authentication on arm64. It's giving "security girlie" energy and honestly? We stan. β¨
πΈ NAME
PR_PAC_RESET_KEYS β reset the calling thread's pointer authentication code keys π
π LIBRARY
Standard C library (libc, -lc). The usual suspects, no cap.
π SYNOPSIS
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
int prctl(PR_PAC_RESET_KEYS, unsigned long keys, 0L, 0L, 0L);
β¨ DESCRIPTION
Okay so the whole vibe here: this securely resets your thread's pointer authentication keys to fresh random values that the kernel generates for you. Like a glow-up for your crypto keys, except the old ones get yeeted. π¦
The set of keys you're resetting is specified by keys, and bestie, it has to be a logical OR of zero or more of these:
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.
And for PR_PAC_APGAKEY, the manpage really said:
(Yes folks, there really is no generic B key.)
I cannot make this up. The kernel devs are funny for that one. π No generic B key. None. Don't ask. π
π«Ά the special case (iykyk)
As a special case, if keys is zero, then all the keys are reset. And here's the tea: since new keys could get added in the future, this is literally the recommended way to completely wipe the existing keys when you're establishing a clean execution context. So when in doubt, pass that zero and let it cook. π₯
π one thing you do NOT need to do
There is no need to use PR_PAC_RESET_KEYS in preparation for calling execve(2), because execve(2) resets all the pointer authentication keys for you. It's already on top of it. Don't do extra credit that nobody asked for. Periodt. π
β RETURN VALUE
- On success,
0is returned. Slay. - On error,
-1is returned, anderrnois set to indicate the error. Not slay, but informative. π«
π ERRORS
EINVALβkeyscontains set bits that are invalid or unsupported on this platform.
π STANDARDS
Linux. arm64 only. So if you're on x86 bestieβ¦ this is not your moment. π
π§ HISTORY
Linux 5.0 (arm64). A modern classic, honestly.
π¨ CAVEATS β please read this part, I'm begging
Because the compiler or run-time environment may be using some or all of the keys, a successful PR_PAC_RESET_KEYS may crash the calling process.
Girl. Not a vibe. π
The conditions for using it safely are complex and system-dependent, so there's genuinely no simple answer here. And the manpage's official advice is basically:
Don't use it unless you know what you are doing.
That's not me being dramatic, that's literally the text. If you don't know exactly what you're doing, this call will humble you instantly. Main character energy only in the sense that the main character gets absolutely destroyed in scene one. π
π SEE ALSO
And for more information, see the kernel source file Documentation/arch/arm64/pointer-authentication.rst. π
That's the whole page, bestie. This was pulled from Linux man-pages 6.20, dated 2026-02-08 β so like, fresh off the press. Go forth and reset responsibly, or honestly, don't reset at all unless you're built different. πβ¨π
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 2020, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms