]> git.ipfire.org Git - thirdparty/man-pages.git/blobdiff - man2/prctl.2
pldd.1, bpf.2, chdir.2, clone.2, fanotify_init.2, fanotify_mark.2, intro.2, ipc.2...
[thirdparty/man-pages.git] / man2 / prctl.2
index c6d828a910f9da4938b0f8acb34bbdd4621a1c79..fdbea1baa126c29df978968f89dcefafed0fa787 100644 (file)
 .\" 2014-11-10 Dave Hansen, document PR_MPX_{EN,DIS}ABLE_MANAGEMENT
 .\"
 .\"
-.TH PRCTL 2 2016-12-12 "Linux" "Linux Programmer's Manual"
+.TH PRCTL 2 2019-08-02 "Linux" "Linux Programmer's Manual"
 .SH NAME
 prctl \- operations on a process
 .SH SYNOPSIS
 .nf
 .B #include <sys/prctl.h>
-.sp
+.PP
 .BI "int prctl(int " option ", unsigned long " arg2 ", unsigned long " arg3 ,
 .BI "          unsigned long " arg4 ", unsigned long " arg5 );
 .fi
@@ -112,6 +112,15 @@ In all of the above operations,
 and
 .I arg5
 must be specified as 0.
+.IP
+Higher-level interfaces layered on top of the above operations are
+provided in the
+.BR libcap (3)
+library in the form of
+.BR cap_get_ambient (3),
+.BR cap_set_ambient (3),
+and
+.BR cap_reset_ambient (3).
 .TP
 .BR PR_CAPBSET_READ " (since Linux 2.6.25)"
 Return (as the function result) 1 if the capability specified in
@@ -124,11 +133,16 @@ The capability bounding set dictates
 whether the process can receive the capability through a
 file's permitted capability set on a subsequent call to
 .BR execve (2).
-
+.IP
 If the capability specified in
 .I arg2
 is not valid, then the call fails with the error
 .BR EINVAL .
+.IP
+A higher-level interface layered on top of this operation is provided in the
+.BR libcap (3)
+library in the form of
+.BR cap_get_bound (3).
 .TP
 .BR PR_CAPBSET_DROP " (since Linux 2.6.25)"
 If the calling thread has the
@@ -138,7 +152,7 @@ capability within its user namespace, then drop the capability specified by
 from the calling thread's capability bounding set.
 Any children of the calling thread will inherit the newly
 reduced bounding set.
-
+.IP
 The call fails with the error:
 .B EPERM
 if the calling thread does not have the
@@ -150,6 +164,11 @@ does not represent a valid capability; or
 .BR EINVAL
 if file capabilities are not enabled in the kernel,
 in which case bounding sets are not supported.
+.IP
+A higher-level interface layered on top of this operation is provided in the
+.BR libcap (3)
+library in the form of
+.BR cap_drop_bound (3).
 .TP
 .BR PR_SET_CHILD_SUBREAPER " (since Linux 3.4)"
 .\" commit ebec18a6d3aa1e7d84aab16225e87fd25170ec2b
@@ -160,7 +179,7 @@ set the "child subreaper" attribute of the calling process;
 if
 .I arg2
 is zero, unset the attribute.
-
+.IP
 A subreaper fulfills the role of
 .BR init (1)
 for its descendant processes.
@@ -177,14 +196,15 @@ will receive a
 signal and will be able to
 .BR wait (2)
 on the process to discover its termination status.
-
-The setting of this bit is not inherited by children created by
+.IP
+The setting of the "child subreaper" attribute
+is not inherited by children created by
 .BR fork (2)
 and
 .BR clone (2).
 The setting is preserved across
 .BR execve (2).
-
+.IP
 Establishing a subreaper process is useful in session management frameworks
 where a hierarchical group of processes is managed by a subreaper process
 that needs to be informed when one of the processes\(emfor example,
@@ -205,7 +225,7 @@ in the location pointed to by
 Set the state of the "dumpable" flag,
 which determines whether core dumps are produced for the calling process
 upon delivery of a signal whose default behavior is to produce a core dump.
-
+.IP
 In kernels up to and including 2.6.12,
 .I arg2
 must be either 0
@@ -227,7 +247,7 @@ for security reasons, this feature has been removed.
 .I /proc/sys/fs/\:suid_dumpable
 in
 .BR proc (5).)
-
+.IP
 Normally, this flag is set to 1.
 However, it is reset to the current value contained in the file
 .IR /proc/sys/fs/\:suid_dumpable
@@ -262,7 +282,7 @@ Processes that are not dumpable can not be attached via
 see
 .BR ptrace (2)
 for further details.
-
+.IP
 If a process is not dumpable,
 the ownership of files in the process's
 .IR /proc/[pid]
@@ -302,7 +322,7 @@ FP32 or FP64 ABIs.
 When more restrictive code is linked in,
 the overall requirement for the process is to use the more
 restrictive floating-point mode.
-
+.IP
 Because the kernel has no means of knowing in advance
 which mode the process should be executed in,
 and because these restrictions can
@@ -310,7 +330,7 @@ change over the lifetime of the process, the
 .B PR_SET_FP_MODE
 operation is provided to allow control of the floating-point mode
 from user space.
-
+.IP
 .\" https://dmz-portal.mips.com/wiki/MIPS_O32_ABI_-_FR0_and_FR1_Interlinking
 The
 .I (unsigned int) arg2
@@ -327,7 +347,7 @@ and 64-bit registers are represented as a pair of registers
 (even- and odd- numbered,
 with the even-numbered register containing the lower 32 bits,
 and the odd-numbered register containing the higher 32 bits).
-
+.IP
 When this bit is
 .I set
 (on supported hardware),
@@ -337,8 +357,8 @@ mode).
 Note that modern MIPS implementations (MIPS R6 and newer) support
 .B FR=1
 mode only.
-
-
+.IP
+.IP
 Applications that use the O32 FP32 ABI can operate only when this bit is
 .I unset
 .RB ( FR=0 ;
@@ -401,10 +421,10 @@ are ignored.
 Get the current floating-point mode (see the description of
 .B PR_SET_FP_MODE
 for details).
-
+.IP
 On success,
 the call returns a bit mask which represents the current floating-point mode.
-
+.IP
 The arguments
 .IR arg2 ,
 .IR arg3 ,
@@ -447,26 +467,21 @@ in the location pointed to by
 .IR "(int\ *) arg2" .
 .TP
 .BR PR_SET_KEEPCAPS " (since Linux 2.2.18)"
-Set the state of the calling thread's "keep capabilities" flag,
-which determines whether the thread's permitted
-capability set is cleared when a change is made to the thread's user IDs
-such that the thread's real UID, effective UID, and saved set-user-ID
-all become nonzero when at least one of them previously had the value 0.
-By default, the permitted capability set is cleared when such a change is made;
-setting the "keep capabilities" flag prevents it from being cleared.
+Set the state of the calling thread's "keep capabilities" flag.
+The effect of this flag is described in
+.BR capabilities (7).
 .I arg2
-must be either 0 (permitted capabilities are cleared)
-or 1 (permitted capabilities are kept).
-(A thread's
-.I effective
-capability set is always cleared when such a credential change is made,
-regardless of the setting of the "keep capabilities" flag.)
+must be either 0 (clear the flag)
+or 1 (set the flag).
 The "keep capabilities" value will be reset to 0 on subsequent calls to
 .BR execve (2).
 .TP
 .BR PR_GET_KEEPCAPS " (since Linux 2.2.18)"
 Return (as the function result) the current state of the calling thread's
 "keep capabilities" flag.
+See
+.BR capabilities (7)
+for a description of this flag.
 .TP
 .BR PR_MCE_KILL " (since Linux 2.6.32)"
 Set the machine check memory corruption kill policy for the calling thread.
@@ -523,9 +538,7 @@ Usually these fields are set by the kernel and dynamic loader (see
 for more information) and a regular application should not use this feature.
 However, there are cases, such as self-modifying programs,
 where a program might find it useful to change its own memory map.
-This feature is available only if the kernel is built with the
-.BR CONFIG_CHECKPOINT_RESTORE
-option enabled.
+.IP
 The calling process must have the
 .BR CAP_SYS_RESOURCE
 capability.
@@ -539,12 +552,18 @@ The
 and
 .I arg5
 arguments must be zero if unused.
+.IP
+Before Linux 3.10,
+.\" commit 52b3694157e3aa6df871e283115652ec6f2d31e0
+this feature is available only if the kernel is built with the
+.BR CONFIG_CHECKPOINT_RESTORE
+option enabled.
 .RS
 .TP
 .BR PR_SET_MM_START_CODE
 Set the address above which the program text can run.
 The corresponding memory area must be readable and executable,
-but not writable or sharable (see
+but not writable or shareable (see
 .BR mprotect (2)
 and
 .BR mmap (2)
@@ -553,19 +572,19 @@ for more information).
 .BR PR_SET_MM_END_CODE
 Set the address below which the program text can run.
 The corresponding memory area must be readable and executable,
-but not writable or sharable.
+but not writable or shareable.
 .TP
 .BR PR_SET_MM_START_DATA
 Set the address above which initialized and
 uninitialized (bss) data are placed.
 The corresponding memory area must be readable and writable,
-but not executable or sharable.
+but not executable or shareable.
 .TP
 .B PR_SET_MM_END_DATA
 Set the address below which initialized and
 uninitialized (bss) data are placed.
 The corresponding memory area must be readable and writable,
-but not executable or sharable.
+but not executable or shareable.
 .TP
 .BR PR_SET_MM_START_STACK
 Set the start address of the stack.
@@ -590,7 +609,7 @@ value.
 The requirements for the address are the same as for the
 .BR PR_SET_MM_START_BRK
 option.
-.P
+.PP
 The following options are available since Linux 3.5.
 .\" commit fe8c7f5cbf91124987106faa3bdf0c8b955c4cf7
 .TP
@@ -647,11 +666,44 @@ memory area for the ELF
 .IR \.text
 section).
 .IP
-The second limitation is that such transitions can be done only once
-in a process life time.
-Any further attempts will be rejected.
-This should help system administrators monitor unusual
-symbolic-link transitions over all processes running on a system.
+In Linux 4.9 and earlier, the
+.\" commit 3fb4afd9a504c2386b8435028d43283216bf588e
+.BR PR_SET_MM_EXE_FILE
+operation can be performed only once in a process's lifetime;
+attempting to perform the operation a second time results in the error
+.BR EPERM .
+This restriction was enforced for security reasons that were subsequently
+deemed specious,
+and the restriction was removed in Linux 4.10 because some
+user-space applications needed to perform this operation more than once.
+.PP
+The following options are available since Linux 3.18.
+.\" commit f606b77f1a9e362451aca8f81d8f36a3a112139e
+.TP
+.BR PR_SET_MM_MAP
+Provides one-shot access to all the addresses by passing in a
+.I struct prctl_mm_map
+(as defined in \fI<linux/prctl.h>\fP).
+The
+.I arg4
+argument should provide the size of the struct.
+.IP
+This feature is available only if the kernel is built with the
+.BR CONFIG_CHECKPOINT_RESTORE
+option enabled.
+.TP
+.BR PR_SET_MM_MAP_SIZE
+Returns the size of the
+.I struct prctl_mm_map
+the kernel expects.
+This allows user space to find a compatible struct.
+The
+.I arg4
+argument should be a pointer to an unsigned int.
+.IP
+This feature is available only if the kernel is built with the
+.BR CONFIG_CHECKPOINT_RESTORE
+option enabled.
 .RE
 .TP
 .BR PR_MPX_ENABLE_MANAGEMENT ", " PR_MPX_DISABLE_MANAGEMENT " (since Linux 3.19) "
@@ -668,7 +720,7 @@ and
 .IR arg5
 .\" commit e9d1b4f3c60997fe197bf0243cb4a41a44387a88
 arguments must be zero.
-
+.IP
 MPX is a hardware-assisted mechanism for performing bounds checking on
 pointers.
 It consists of a set of registers storing bounds information
@@ -681,7 +733,7 @@ These tables are called "bounds tables" and the MPX
 .BR prctl ()
 operations control
 whether the kernel manages their allocation and freeing.
-
+.IP
 When management is enabled, the kernel will take over allocation
 and freeing of the bounds tables.
 It does this by trapping the #BR exceptions that result
@@ -691,28 +743,32 @@ it allocates the table and populates the bounds directory
 with the location of the new table.
 For freeing, the kernel checks to see if bounds tables are
 present for memory which is not allocated, and frees them if so.
-
+.IP
 Before enabling MPX management using
 .BR PR_MPX_ENABLE_MANAGEMENT ,
 the application must first have allocated a user-space buffer for
 the bounds directory and placed the location of that directory in the
 .I bndcfgu
 register.
-
-These calls will fail if the CPU or kernel does not support MPX.
+.IP
+These calls fail if the CPU or kernel does not support MPX.
 Kernel support for MPX is enabled via the
 .BR CONFIG_X86_INTEL_MPX
 configuration option.
 You can check whether the CPU supports MPX by looking for the 'mpx'
 CPUID bit, like with the following command:
-
-       cat /proc/cpuinfo | grep ' mpx '
-
+.IP
+.in +4n
+.EX
+cat /proc/cpuinfo | grep ' mpx '
+.EE
+.in
+.IP
 A thread may not switch in or out of long (64-bit) mode while MPX is
 enabled.
-
+.IP
 All threads in a process are affected by these calls.
-
+.IP
 The child of a
 .BR fork (2)
 inherits the state of MPX management.
@@ -721,7 +777,7 @@ During
 MPX management is reset to a state as if
 .BR PR_MPX_DISABLE_MANAGEMENT
 had been called.
-
+.IP
 For further information on Intel MPX, see the kernel source file
 .IR Documentation/x86/intel_mpx.txt .
 .TP
@@ -754,7 +810,7 @@ the returned string will be null-terminated.
 .BR PR_SET_NO_NEW_PRIVS " (since Linux 3.5)"
 Set the calling thread's
 .I no_new_privs
-bit to the value in
+attribute to the value in
 .IR arg2 .
 With
 .I no_new_privs
@@ -766,32 +822,38 @@ that could not have been done without the
 call (for example,
 rendering the set-user-ID and set-group-ID mode bits,
 and file capabilities non-functional).
-Once set, this bit cannot be unset.
-The setting of this bit is inherited by children created by
+Once set, this the
+.I no_new_privs
+attribute cannot be unset.
+The setting of this attribute is inherited by children created by
 .BR fork (2)
 and
 .BR clone (2),
 and preserved across
 .BR execve (2).
-
+.IP
 Since Linux 4.10,
 the value of a thread's
 .I no_new_privs
-bit can be viewed via the
+attribute can be viewed via the
 .I NoNewPrivs
 field in the
 .IR /proc/[pid]/status
 file.
-
+.IP
 For more information, see the kernel source file
-.IR Documentation/prctl/no_new_privs.txt .
+.IR Documentation/userspace\-api/no_new_privs.rst
+.\" commit 40fde647ccb0ae8c11d256d271e24d385eed595b
+(or
+.IR Documentation/prctl/no_new_privs.txt
+before Linux 4.13).
 See also
 .BR seccomp (2).
 .TP
 .BR PR_GET_NO_NEW_PRIVS " (since Linux 3.5)"
 Return (as the function result) the value of the
 .I no_new_privs
-bit for the calling thread.
+attribute for the calling thread.
 A value of 0 indicates the regular
 .BR execve (2)
 behavior.
@@ -800,20 +862,12 @@ A value of 1 indicates
 will operate in the privilege-restricting mode described above.
 .TP
 .BR PR_SET_PDEATHSIG " (since Linux 2.1.57)"
-Set the parent death signal
+Set the parent-death signal
 of the calling process to \fIarg2\fP (either a signal value
 in the range 1..maxsig, or 0 to clear).
 This is the signal that the calling process will get when its
 parent dies.
-This value is cleared for the child of a
-.BR fork (2)
-and (since Linux 2.4.36 / 2.6.23)
-when executing a set-user-ID or set-group-ID binary,
-or a binary that has associated capabilities (see
-.BR capabilities (7)).
-This value is preserved across
-.BR execve (2).
-
+.IP
 .IR Warning :
 .\" https://bugzilla.kernel.org/show_bug.cgi?id=43300
 the "parent" in this case is considered to be the
@@ -823,6 +877,38 @@ In other words, the signal will be sent when that thread terminates
 (via, for example,
 .BR pthread_exit (3)),
 rather than after all of the threads in the parent process terminate.
+.IP
+The parent-death signal is sent upon subsequent termination of the parent
+thread and also upon termination of each subreaper process
+(see the description of
+.B PR_SET_CHILD_SUBREAPER
+above) to which the caller is subsequently reparented.
+If the parent thread and all ancestor subreapers have already terminated
+by the time of the
+.BR PR_SET_PDEATHSIG
+operation, then no parent-death signal is sent to the caller.
+.IP
+The parent-death signal is process-directed (see
+.BR signal (7))
+and, if the child installs a handler using the
+.BR sigaction (2)
+.B SA_SIGINFO
+flag, the
+.I si_pid
+field of the
+.I siginfo_t
+argument of the handler contains the PID of the terminating parent process.
+.IP
+The parent-death signal setting is cleared for the child of a
+.BR fork (2).
+It is also
+(since Linux 2.4.36 / 2.6.23)
+.\" commit d2d56c5f51028cb9f3d800882eb6f4cbd3f9099f
+cleared when executing a set-user-ID or set-group-ID binary,
+or a binary that has associated capabilities (see
+.BR capabilities (7));
+otherwise, this value is preserved across
+.BR execve (2).
 .TP
 .BR PR_GET_PDEATHSIG " (since Linux 2.3.15)"
 Return the current value of the parent process death signal,
@@ -853,9 +939,13 @@ is
 .BR PR_SET_PTRACER_ANY ,
 the ptrace restrictions introduced by Yama are effectively disabled for the
 calling process.
-
+.IP
 For further information, see the kernel source file
-.IR Documentation/security/Yama.txt .
+.IR Documentation/admin\-guide/LSM/Yama.rst
+.\" commit 90bb766440f2147486a2acc3e793d7b8348b0c22
+(or
+.IR Documentation/security/Yama.txt
+before Linux 4.13).
 .TP
 .BR PR_SET_SECCOMP " (since Linux 2.6.23)"
 .\" See http://thread.gmane.org/gmane.linux.kernel/542632
@@ -867,12 +957,12 @@ The more recent
 .BR seccomp (2)
 system call provides a superset of the functionality of
 .BR PR_SET_SECCOMP .
-
+.IP
 The seccomp mode is selected via
 .IR arg2 .
 (The seccomp constants are defined in
 .IR <linux/seccomp.h> .)
-
+.IP
 With
 .IR arg2
 set to
@@ -895,7 +985,7 @@ This operation is available only
 if the kernel is configured with
 .B CONFIG_SECCOMP
 enabled.
-
+.IP
 With
 .IR arg2
 set to
@@ -910,7 +1000,7 @@ arbitrary system calls and system call arguments.
 This mode is available only if the kernel is configured with
 .B CONFIG_SECCOMP_FILTER
 enabled.
-
+.IP
 If
 .BR SECCOMP_MODE_FILTER
 filters permit
@@ -925,9 +1015,13 @@ If the filters permit
 .BR prctl ()
 calls, then additional filters can be added;
 they are run in order until the first non-allow result is seen.
-
+.IP
 For further information, see the kernel source file
-.IR Documentation/prctl/seccomp_filter.txt .
+.IR Documentation/userspace\-api/seccomp_filter.rst
+.\" commit c061f33f35be0ccc80f4b8e0aea5dfd2ed7e01a3
+(or
+.IR Documentation/prctl/seccomp_filter.txt
+before Linux 4.13).
 .TP
 .BR PR_GET_SECCOMP " (since Linux 2.6.23)"
 Return (as the function result)
@@ -946,7 +1040,7 @@ This operation is available only
 if the kernel is configured with
 .B CONFIG_SECCOMP
 enabled.
-
+.IP
 Since Linux 3.8, the
 .IR Seccomp
 field of the
@@ -967,6 +1061,106 @@ the "securebits" flags of the calling thread.
 See
 .BR capabilities (7).
 .TP
+.BR PR_GET_SPECULATION_CTRL " (since Linux 4.17)"
+Returns the state of the speculation misfeature specified in
+.IR arg2 .
+Currently, the only permitted value for this argument is
+.BR PR_SPEC_STORE_BYPASS
+(otherwise the call fails with the error
+.BR ENODEV ).
+.IP
+The return value uses bits 0-3 with the following meaning:
+.RS
+.TP
+.BR PR_SPEC_PRCTL
+Mitigation can be controlled per thread by
+.B PR_SET_SPECULATION_CTRL
+.TP
+.BR PR_SPEC_ENABLE
+The speculation feature is enabled, mitigation is disabled.
+.TP
+.BR PR_SPEC_DISABLE
+The speculation feature is disabled, mitigation is enabled
+.TP
+.BR PR_SPEC_FORCE_DISABLE
+Same as
+.B PR_SPEC_DISABLE
+but cannot be undone.
+.RE
+.IP
+If all bits are 0,
+then the CPU is not affected by the speculation misfeature.
+.IP
+If
+.B PR_SPEC_PRCTL
+is set, then per-thread control of the mitigation is available.
+If not set,
+.BR prctl ()
+for the speculation misfeature will fail.
+.IP
+The
+.IR arg3 ,
+.IR arg4 ,
+and
+.I arg5
+arguments must be specified as 0; otherwise the call fails with the error
+.BR EINVAL .
+.TP
+.BR PR_SET_SPECULATION_CTRL " (since Linux 4.17)"
+.\" commit b617cfc858161140d69cc0b5cc211996b557a1c7
+.\" commit 356e4bfff2c5489e016fdb925adbf12a1e3950ee
+Sets the state of the speculation misfeature specified in
+.IR arg2 .
+Currently, the only permitted value for this argument is
+.B PR_SPEC_STORE_BYPASS
+(otherwise the call fails with the error
+.BR ENODEV ).
+This setting is a per-thread attribute.
+The
+.IR arg3
+argument is used to hand in the control value,
+which is one of the following:
+.RS
+.TP
+.BR PR_SPEC_ENABLE
+The speculation feature is enabled, mitigation is disabled.
+.TP
+.BR PR_SPEC_DISABLE
+The speculation feature is disabled, mitigation is enabled
+.TP
+.BR PR_SPEC_FORCE_DISABLE
+Same as
+.B PR_SPEC_DISABLE
+but cannot be undone.
+A subsequent
+.B
+prctl(..., PR_SPEC_ENABLE)
+will fail with the error
+.BR EPERM .
+.RE
+.IP
+Any other value in
+.IR arg3
+will result in the call failing with the error
+.BR ERANGE .
+.IP
+The
+.I arg4
+and
+.I arg5
+arguments must be specified as 0; otherwise the call fails with the error
+.BR EINVAL .
+.IP
+The speculation feature can also be controlled by the
+.B spec_store_bypass_disable
+boot parameter.
+This parameter may enforce a read-only policy which will result in the
+.BR prctl (2)
+call failing with the error
+.BR ENXIO .
+For further details, see the kernel source file
+.IR Documentation/admin-guide/kernel-parameters.txt .
+.TP
 .BR PR_SET_THP_DISABLE " (since Linux 3.15)"
 .\" commit a0715cc22601e8830ace98366c0c2bd8da52af52
 Set the state of the "THP disable" flag for the calling thread.
@@ -996,7 +1190,7 @@ For more information on performance counters, see the Linux kernel source file
 Originally called
 .BR PR_TASK_PERF_COUNTERS_DISABLE ;
 .\" commit 1d1c7ddbfab358445a542715551301b7fc363e28
-renamed (with same numerical value)
+renamed (retaining the same numerical value)
 in Linux 2.6.32.
 .\"
 .TP
@@ -1045,24 +1239,25 @@ this operation expects a user-space buffer of 8 (not 4) bytes on these ABIs.
 Each thread has two associated timer slack values:
 a "default" value, and a "current" value.
 This operation sets the "current" timer slack value for the calling thread.
+.I arg2
+is an unsigned long value, then maximum "current" value is ULONG_MAX and
+the minimum "current" value is 1.
 If the nanosecond value supplied in
 .IR arg2
 is greater than zero, then the "current" value is set to this value.
 If
 .I arg2
-is less than or equal to zero,
-.\" It seems that it's not possible to set the timer slack to zero;
-.\" The minimum value is 1? Seems a little strange.
+is equal to zero,
 the "current" timer slack is reset to the
 thread's "default" timer slack value.
-
+.IP
 The "current" timer slack is used by the kernel to group timer expirations
 for the calling thread that are close to one another;
 as a consequence, timer expirations for the thread may be
 up to the specified number of nanoseconds late (but will never expire early).
 Grouping timer expirations can help reduce system power consumption
 by minimizing CPU wake-ups.
-
+.IP
 The timer expirations affected by timer slack are those set by
 .BR select (2),
 .BR pselect (2),
@@ -1082,11 +1277,11 @@ and
 .BR pthread_rwlock_timedwrlock (3),
 and
 .BR sem_timedwait (3)).
-
+.IP
 Timer slack is not applied to threads that are scheduled under
 a real-time scheduling policy (see
 .BR sched_setscheduler (2)).
-
+.IP
 When a new thread is created,
 the two timer slack values are made the same as the "current" value
 of the creating thread.
@@ -1097,9 +1292,11 @@ The timer slack values of
 .IR init
 (PID 1), the ancestor of all processes,
 are 50,000 nanoseconds (50 microseconds).
-The timer slack values are preserved across
+The timer slack value is inherited by a child created via
+.BR fork(2),
+and is preserved across
 .BR execve (2).
-
+.IP
 Since Linux 4.6, the "current" timer slack value of any process
 can be examined and changed via the file
 .IR /proc/[pid]/timerslack_ns .
@@ -1110,7 +1307,8 @@ See
 Return (as the function result)
 the "current" timer slack value of the calling thread.
 .TP
-.BR PR_SET_TIMING " (since Linux 2.6.0-test4)"
+.BR PR_SET_TIMING " (since Linux 2.6.0)"
+.\" Precisely: Linux 2.6.0-test4
 Set whether to use (normal, traditional) statistical process timing or
 accurate timestamp-based process timing, by passing
 .B PR_TIMING_STATISTICAL
@@ -1127,7 +1325,8 @@ is not currently implemented
 .\" and looking at the patch history, it appears
 .\" that it never did anything.
 .TP
-.BR PR_GET_TIMING " (since Linux 2.6.0-test4)"
+.BR PR_GET_TIMING " (since Linux 2.6.0)"
+.\" Precisely: Linux 2.6.0-test4
 Return (as the function result) which process timing method is currently
 in use.
 .TP
@@ -1460,6 +1659,12 @@ and
 .IR arg3
 does not specify a valid capability.
 .TP
+.B ENODEV
+.I option
+was
+.BR PR_SET_SPECULATION_CTRL
+the kernel or CPU does not support the requested speculation misfeature.
+.TP
 .B ENXIO
 .I option
 was
@@ -1469,6 +1674,15 @@ or
 and the kernel or the CPU does not support MPX management.
 Check that the kernel and processor have MPX support.
 .TP
+.B ENXIO
+.I option
+was
+.BR PR_SET_SPECULATION_CTRL
+implies that the control of the selected speculation misfeature is not possible.
+See
+.BR PR_GET_SPECULATION_CTRL
+for the bit fields to determine which option is available.
+.TP
 .B EOPNOTSUPP
 .I option
 is
@@ -1492,9 +1706,17 @@ or tried to set a flag whose corresponding locked flag was set
 .B EPERM
 .I option
 is
+.BR PR_SET_SPECULATION_CTRL
+wherein the speculation was disabled with
+.B PR_SPEC_FORCE_DISABLE
+and caller tried to enable it again.
+.TP
+.B EPERM
+.I option
+is
 .BR PR_SET_KEEPCAPS ,
 and the caller's
-.B SECURE_KEEP_CAPS_LOCKED
+.B SECBIT_KEEP_CAPS_LOCKED
 flag is set
 (see
 .BR capabilities (7)).
@@ -1529,6 +1751,28 @@ is not present in the process's permitted and inheritable capability sets,
 or the
 .B PR_CAP_AMBIENT_LOWER
 securebit has been set.
+.TP
+.B ERANGE
+.I option
+was
+.BR PR_SET_SPECULATION_CTRL
+and
+.IR arg3
+is neither
+.BR PR_SPEC_ENABLE ,
+.BR PR_SPEC_DISABLE ,
+nor
+.BR PR_SPEC_FORCE_DISABLE .
+.TP
+.B EINVAL
+.I option
+was
+.BR PR_GET_SPECULATION_CTRL
+or
+.BR PR_SET_SPECULATION_CTRL
+and unused arguments to
+.BR prctl ()
+are not 0.
 .SH VERSIONS
 The
 .BR prctl ()
@@ -1541,9 +1785,13 @@ IRIX has a
 system call (also introduced in Linux 2.1.44
 as irix_prctl on the MIPS architecture),
 with prototype
-.sp
+.PP
+.in +4n
+.EX
 .BI "ptrdiff_t prctl(int " option ", int " arg2 ", int " arg3 );
-.sp
+.EE
+.in
+.PP
 and options to get the maximum number of processes per user,
 get the maximum number of processors the calling process can use,
 find out whether a specified process is currently blocked,