diff --git a/lib/libc/sys/mmap.2 b/lib/libc/sys/mmap.2 index 0a838eed54e3..ee2ec686c188 100644 --- a/lib/libc/sys/mmap.2 +++ b/lib/libc/sys/mmap.2 @@ -107,7 +107,7 @@ argument by .Em or Ns 'ing the following values: .Pp -.Bl -tag -width PROT_WRITE -compact +.Bl -tag -width PROT_CAP_WRITE -compact .It Dv PROT_NONE Pages may not be accessed. .It Dv PROT_READ @@ -116,8 +116,35 @@ Pages may be read. Pages may be written. .It Dv PROT_EXEC Pages may be executed. +.It Dv PROT_CAP_READ +CHERI capabilities may be written to pages. +.It Dv PROT_CAP_WRITE +CHERI capabilities may be read from pages. +.It Dv PROT_CAP_NONE +CHERI capabilities may not be accessed in pages. .El .Pp +When +.Dv PROT_CAP_NONE +is combined with +.Dv PROT_CAP_READ +or +.Dv PROT_CAP_WRITE +it has no effect. +If no +.Dv PROT_CAP_* +flags are included in +.Fa prot +than +.Dv PROT_CAP_READ +and +.Dv PROT_CAP_WRITE +are implied by the presence of +.Dv PROT_READ +and +.Dv PROT_WRITE +respectively. +.Pp In addition to these protection flags, .Fx provides the ability to set the maximum protection of a region allocated by diff --git a/lib/libc/sys/mprotect.2 b/lib/libc/sys/mprotect.2 index f595736631e9..57e77bf06f02 100644 --- a/lib/libc/sys/mprotect.2 +++ b/lib/libc/sys/mprotect.2 @@ -47,35 +47,13 @@ system call changes the specified pages to have protection .Fa prot . .Pp -Currently these protection bits are known, -which can be combined, OR'd together: -.Pp -.Bl -tag -width ".Dv PROT_WRITE" -compact -.It Dv PROT_NONE -No permissions at all. -.It Dv PROT_READ -The pages can be read. -.It Dv PROT_WRITE -The pages can be written. -.It Dv PROT_EXEC -The pages can be executed. -.El -.Pp -In addition to these protection flags, -.Fx -provides the ability to set the maximum protection of a region -(which prevents +The set of protection bits is documented in +.Xr mmap 2 . +Like +.Xr mmap 2 , .Nm -from upgrading the permissions). -This is accomplished by -.Em or Ns 'ing -one or more -.Dv PROT_ -values wrapped in the -.Dv PROT_MAX() -macro into the -.Fa prot -argument. +can set the maximum protection of a region +(which prevents upgrading the permissions). .Sh RETURN VALUES .Rv -std mprotect .Sh ERRORS