aboutsummaryrefslogtreecommitdiff
path: root/lib/libsys
diff options
context:
space:
mode:
authorMark Johnston <markj@FreeBSD.org>2026-04-16 17:46:11 +0000
committerMark Johnston <markj@FreeBSD.org>2026-04-16 17:46:11 +0000
commitfa77fecb0e06ec697e3d7a9ed899e568f1d2090c (patch)
tree8b8f61d85744685998189cd9245e83d5a98326f2 /lib/libsys
parentfe6bf738aaeb3d5fd74aabfcbf01eba827df6594 (diff)
Diffstat (limited to 'lib/libsys')
-rw-r--r--lib/libsys/x86/pkru.317
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/libsys/x86/pkru.3 b/lib/libsys/x86/pkru.3
index 06837a39858d..75580953e6ed 100644
--- a/lib/libsys/x86/pkru.3
+++ b/lib/libsys/x86/pkru.3
@@ -71,13 +71,16 @@ Only one key may apply to a given range at a time.
The default protection key index is zero, it is used even if no key
was explicitly assigned to the address, or if the key was removed.
.Pp
-The protection prevents the system from accessing user addresses as well
-as the user applications.
-When a system call was unable to read or write user memory due to key
-protection, it returns the
-.Er EFAULT
-error code.
-Note that some side effects may have occurred if this error is reported.
+If the user application attempts a memory access which is prohibited by the
+PKRU register, the offending thread receives a synchronous
+.Dv SIGSEGV
+signal with
+.Va si_code
+set to
+.Dv SEGV_PKUERR .
+PKRU protections might prevent the kernel from accessing protected
+user addresses when handling system calls, but this is not guaranteed and
+must not be relied upon.
.Pp
Both 64-bit and 32-bit applications can use protection keys.
More information about the hardware feature is provided in the IA32 Software