---
name: "PR_PAC_RESET_KEYS"
section: "2const"
platform: "linux"
package: "man-pages"
version: "6.19-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/PR_PAC_RESET_KEYS"
---

# PR\_PAC\_RESET\_KEYS(2const)

reset the calling thread's pointer authentication code keys

## NAME

PR\_PAC\_RESET\_KEYS - reset the calling thread's pointer authentication code keys

## LIBRARY

Standard C library (*libc*, *-lc*)

## 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

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)](/execve/2.md), since [**execve**(2)](/execve/2.md) resets all the pointer authentication keys.

## RETURN VALUE

On success, 0 is returned. On error, -1 is returned, and *errno* is set to indicate the error.

## ERRORS

- **EINVAL**

  *keys* contains set bits that are invalid or unsupported on this platform.

## STANDARDS

Linux. arm64 only.

## HISTORY

Linux 5.0 (arm64).

## CAVEATS

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. The conditions for using it safely are complex and system-dependent. Don't use it unless you know what you are doing.

## SEE ALSO

[**prctl**(2)](/prctl/2.md)

For more information, see the kernel source file *Documentation/arch/arm64/pointer-authentication.rst*.
