PR_SET_TAGGED_ADDR_CTRL(2const)

πŸ’– PR_SET_TAGGED_ADDR_CTRL πŸ’–

okay bestie so welcome to the PR_SET_TAGGED_ADDR_CTRL(2const) page β€” yes that manual name is a whole mouthful, we're just gonna roll with it ✨

πŸŽ€ NAME πŸŽ€

PR_SET_TAGGED_ADDR_CTRL β€” literally the control knob for whether we let tagged user-space addresses get passed to the kernel, no cap 🫢

πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc) β€” the classic, the icon, the one you already have πŸ’…

✨ SYNOPSIS ✨

#include <linux/prctl.h>  /* Definition of PR_* constants */
#include <sys/prctl.h>

int prctl(PR_SET_TAGGED_ADDR_CTRL, long mode, 0L, 0L, 0L);

🌸 DESCRIPTION 🌸

So this bad boy controls support for passing tagged user-space addresses to the kernel. And what's a tagged address, you ask? It's an address where bits 56β€”63 are not all zero 🧠✍️

Which level of support you get is selected by support, and it can be one of these two moods:

  • 0L β€” addresses that you pass in for the purpose of being dereferenced by the kernel must be untagged. plain. simple. no decorations allowed πŸ’€
  • PR_TAGGED_ADDR_ENABLE β€” addresses that you pass in for the purpose of being dereferenced by the kernel may be tagged, with the exceptions we're about to list below πŸ‘‡

On success, whatever mode you specified is set for the calling thread ⭐

And listen β€” if prctl(PR_SET_TAGGED_ADDR_CTRL, 0L, 0L, 0L, 0L) fails with EINVAL, then just know: all addresses passed to the kernel must be untagged. like, all of them, periodt 😭


🚫 the always-untagged list 🚫

Irrespective of which mode is set, addresses passed to certain interfaces must always be untagged:

(Prior to Linux 5.6 these accepted tagged addresses, but the behavior may not be what you expect. Don't rely on it.) πŸ™ˆ
  • 'polymorphic' interfaces that accept pointers to arbitrary types cast to a void * or other generic type, specifically prctl(), ioctl(2), and in general setsockopt(2) (only certain specific setsockopt(2) options allow tagged addresses).

This list of exclusions may shrink when moving from one kernel version to a later kernel version πŸ¦‹ While the kernel may make some guarantees for backwards compatibility reasons, for the purposes of new software the effect of passing tagged addresses to these interfaces is unspecified. so like, don't. πŸ”₯


🧬 inheritance tea 🧬

The mode set by this call is inherited across fork(2) and clone(2) πŸ‘‘ and then execve(2) resets the mode to 0 (i.e., tagged addresses not permitted in the user/kernel ABI). the vibes do not survive an exec, bestie πŸ’œ

🌈 RETURN VALUE 🌈

On success, 0 is returned πŸŽ‰ On error, -1 is returned, and errno is set to indicate the error πŸ˜”

πŸ’€ ERRORS πŸ’€

  • EINVAL β€” mode is invalid or unsupported. not every vibe is a valid vibe, sorry.
  • EINVAL β€” this feature is disabled via /proc/sys/abi/tagged_addr_disabled. the door is locked from the inside πŸšͺπŸ”’

πŸ“ FILES πŸ“

  • /proc/sys/abi/tagged_addr_disabled

⭐ STANDARDS ⭐

Linux. arm64 only β€” so if you're on anything else, this whole page is not your business πŸ’…

πŸ•°οΈ HISTORY πŸ•°οΈ

Linux 5.4 (arm64). a classic from the archives ✨

⚠️ CAVEATS ⚠️

okay this is the serious part, pay attention 🫢

This call is primarily intended for use by the run-time environment. A successful PR_SET_TAGGED_ADDR_CTRL call elsewhere 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.

like. she is not for casual experimentation. she is for people who have read the kernel source. respect her πŸŽ€

πŸ‘€ SEE ALSO πŸ‘€

For more information, see the kernel source file Documentation/arm64/tagged-address-abi.rst πŸ“–


and that's the page, bestie!! this was brought to you by Linux man-pages 6.20, dated 2026-02-08 πŸ’– mwah, go read the kernel docs, ily, bye πŸŒΈπŸ¦‹βœ¨

πŸ“¦ 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