PR_SET_TAGGED_ADDR_CTRL
(2const)control support for passing tagged user-space addresses to the kernel
LIBRARY
DESCRIPTION
Controls support for passing tagged user-space addresses to the kernel (i.e., addresses where bits 56—63 are not all zero).
The level of support is selected by support, which can be one of the following:
- 0L
- Addresses that are passed for the purpose of being dereferenced by the kernel must be untagged.
- PR_TAGGED_ADDR_ENABLE
- Addresses that are passed for the purpose of being dereferenced by the kernel may be tagged, with the exceptions summarized below.
On success, the mode specified in mode is set for the calling thread.
If prctl(PR_SET_TAGGED_ADDR_CTRL, 0L, 0L, 0L, 0L) fails with EINVAL, then all addresses passed to the kernel must be untagged.
Irrespective of which mode is set, addresses passed to certain interfaces must always be untagged:
- •
- brk(2), mmap(2), shmat(2), shmdt(2), and the new_address argument of mremap(2).
- (Prior to Linux 5.6 these accepted tagged addresses, but the behaviour 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.
The mode set by this call is inherited across fork(2) and clone(2). The mode is reset by execve(2) to 0 (i.e., tagged addresses not permitted in the user/kernel ABI).