From owner-dev-commits-src-all@freebsd.org Tue Sep 7 16:29:13 2021 Return-Path: Delivered-To: dev-commits-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D3A09668575; Tue, 7 Sep 2021 16:29:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4H3rLx5VR2z3Hbd; Tue, 7 Sep 2021 16:29:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 9CBFD1565C; Tue, 7 Sep 2021 16:29:13 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 187GTDEc037002; Tue, 7 Sep 2021 16:29:13 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 187GTDls037001; Tue, 7 Sep 2021 16:29:13 GMT (envelope-from git) Date: Tue, 7 Sep 2021 16:29:13 GMT Message-Id: <202109071629.187GTDls037001@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Brooks Davis Subject: git: 85bea309f935 - main - mprotect.2: Improve the description of prot MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: brooks X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 85bea309f935111cb362035795a59c263536b065 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-all@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for all branches of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 07 Sep 2021 16:29:13 -0000 The branch main has been updated by brooks: URL: https://cgit.FreeBSD.org/src/commit/?id=85bea309f935111cb362035795a59c263536b065 commit 85bea309f935111cb362035795a59c263536b065 Author: Brooks Davis AuthorDate: 2021-09-07 16:28:50 +0000 Commit: Brooks Davis CommitDate: 2021-09-07 16:28:50 +0000 mprotect.2: Improve the description of prot The new wording for standard flags is losely based on the POSIX description. Make it clearer that PROT_MAX() is a local extension. Reviewed by: alc, mckusick, imp, kib, markj Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D31777 --- lib/libc/sys/mprotect.2 | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/lib/libc/sys/mprotect.2 b/lib/libc/sys/mprotect.2 index 5c024dd24d56..c2c7701d624e 100644 --- a/lib/libc/sys/mprotect.2 +++ b/lib/libc/sys/mprotect.2 @@ -28,7 +28,7 @@ .\" @(#)mprotect.2 8.1 (Berkeley) 6/9/93 .\" $FreeBSD$ .\" -.Dd September 3, 2021 +.Dd September 7, 2021 .Dt MPROTECT 2 .Os .Sh NAME @@ -47,12 +47,16 @@ 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: +The +.Fa prot +argument shall be +.Dv PROT_NONE +(no permissions at all) +or the bitwise +.Em or +of one or more of the following values: .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 @@ -61,13 +65,16 @@ The pages can be written. The pages can be executed. .El .Pp -In addition to these protection flags, +In addition to these standard protection flags, +the .Fx +implementation of +.Fn mprotect provides the ability to set the maximum protection of a region (which prevents .Nm -from upgrading the permissions). -This is accomplished by +from adding to the permissions later). +This is accomplished by bitwise .Em or Ns 'ing one or more .Dv PROT_