From nobody Tue Oct 08 06:50:42 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XN69G3g2zz5Z3nF; Tue, 08 Oct 2024 06:50:42 +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 "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XN69G383Lz40kR; Tue, 8 Oct 2024 06:50:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728370242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3GuYwGmRjE0gj9I0yI/sfIbHys7rrruzdxXDEmMXpJ4=; b=pKjnoec0It3SNDLmECmOBQFU4JVrlFZLt7e3LmqoY+tjgi4J2xb9S1AvRriQOa0DWc9NWI SKt9QcEDPBbQt33cL/vIF/r+e8FSq7MVmo5RAJ9BXkHoW1gcnUa+v47Qp7ZOvtV9uMeaAO JYg8RVWlPVsGefAzFJFe/YnYST5RSzHHxewdVj7YE9gzUCPGjl0AV9hh0OSeBc8xGgx/d6 5oDJgmIjfmu+gcZKelhn14QWpFe9qMukJCWv1Ld7QvntqBcy8lVvKSVVzO4vqdCm7KNKA9 tOQgOr4Sm7vUXGQ2SbqdZXhNOTmHwfJ1CYgTDDVet4gAItrrENf6T9HfTGf+wQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728370242; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=3GuYwGmRjE0gj9I0yI/sfIbHys7rrruzdxXDEmMXpJ4=; b=N5GBNLcV9EjsxRKXZTCP6rWdgTrTpjfPAAULS/NVFYl7c2OKWaE0UHJANOkk+mPTAWncDk j3NvhgWt7BtKkMekPoeO6atKsqrGOyh63l6T9eT1+aX+j6KV0xxqk2R8Kicq7grLzs+j9r 3rlOj4p9vfcnWTrDUUhg9qcolE20eLrirSAOYX2vd54CI9f/bVBYPmncxkPw6ojiTFDZwX muw/49EzAeVE6usubfVVbqsQRcUZhFByOSzX8QYMW65OHg0uXKsnlgett7BChDaG5+taUE iMFMGBfY3TUwPe5uR/qPYuTSFpcGh5wb/xxSOATi48zjvNa3sdmK3j9a1T2WPg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728370242; a=rsa-sha256; cv=none; b=Vnkuf6H7vu47+XU253l4Qy/Prer+rFqDoywOYuPxmipEbH83scK96DR/cjrE/oKO7kFOfJ ZumQ8nTW5ve2nuCylCF+BGYlRlReXa591jeBoaKWlxC0wsJWXkblJ79BUPgIOvyqfGD+vm rqwI0NIe0YWjCDEd+U59Botdf2H3Q4UVGBlJubkRMHpH7Ia6das2a6mtdvdpbJ4ItHkPXQ jIV2ligFgc6YgPitnLuQGfzt/GoaFIn/ctGU7oeW6P2VMaND6MEa4DJ3jrWuzjUmHb6a0B wQHqDkeuEHe4XlpP+phwkB9ELzehbObOfS5S+EACzDsS7FBTk7X2Nvk0rR/J1g== 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 4XN69G2dPtzKCN; Tue, 8 Oct 2024 06:50:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4986ogna026505; Tue, 8 Oct 2024 06:50:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4986ognB026502; Tue, 8 Oct 2024 06:50:42 GMT (envelope-from git) Date: Tue, 8 Oct 2024 06:50:42 GMT Message-Id: <202410080650.4986ognB026502@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Konstantin Belousov Subject: git: 409c2fa385aa - main - kinfo_vmentry: report max protection List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kib X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 409c2fa385aa34baf7dd86bed2e86fbff16ad86d Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=409c2fa385aa34baf7dd86bed2e86fbff16ad86d commit 409c2fa385aa34baf7dd86bed2e86fbff16ad86d Author: Konstantin Belousov AuthorDate: 2024-10-07 07:49:43 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-08 06:50:17 +0000 kinfo_vmentry: report max protection Reviewed by: brooks, markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46971 --- sys/kern/kern_proc.c | 6 ++++++ sys/sys/user.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 02d3b9fd69cd..422873ee14c2 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2678,6 +2678,12 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) kve->kve_protection |= KVME_PROT_WRITE; if (entry->protection & VM_PROT_EXECUTE) kve->kve_protection |= KVME_PROT_EXEC; + if (entry->max_protection & VM_PROT_READ) + kve->kve_protection |= KVME_MAX_PROT_READ; + if (entry->max_protection & VM_PROT_WRITE) + kve->kve_protection |= KVME_MAX_PROT_WRITE; + if (entry->max_protection & VM_PROT_EXECUTE) + kve->kve_protection |= KVME_MAX_PROT_EXEC; if (entry->eflags & MAP_ENTRY_COW) kve->kve_flags |= KVME_FLAG_COW; diff --git a/sys/sys/user.h b/sys/sys/user.h index 1fd802b03a42..2025dc5cb47b 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -506,6 +506,9 @@ struct kinfo_lockf { #define KVME_PROT_READ 0x00000001 #define KVME_PROT_WRITE 0x00000002 #define KVME_PROT_EXEC 0x00000004 +#define KVME_MAX_PROT_READ 0x00010000 +#define KVME_MAX_PROT_WRITE 0x00020000 +#define KVME_MAX_PROT_EXEC 0x00040000 #define KVME_FLAG_COW 0x00000001 #define KVME_FLAG_NEEDS_COPY 0x00000002