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, 0 is returned. Slay.
  • On error, -1 is returned, and errno is set to indicate the error. Not slay, but informative. 🫠

😭 ERRORS

  • EINVAL β€” keys contains 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
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms