From nobody Tue Oct 15 15:05:29 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 4XScpy17S4z5YYSS; Tue, 15 Oct 2024 15:05:30 +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 4XScpx62nnz463l; Tue, 15 Oct 2024 15:05:29 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729004729; 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=l9L1zWuIOtr6/uJp/YEvAs2GP4I1uOR8adR1NSwJ5qQ=; b=hhJBIm1FkwCmg4skTxjyIbRGlQLvxk0DcZEUs6BrM692WuXrawG4MLzMO2qPCcd4THdFqq xi0ydY3h7UTywcvwC3jw+ZvSBvcc9LSZbctM6bZ2mPOOOHJJvEAzk9FsDcmhztFw0UX7t1 dZTSlWUFUjPTNxUsFeiGp21njC+2T/1y/vak5HY6Gb3RDS+/VkMiIYJrIRURtYxRZniHvA veaG/5srXExp0QmTZ8pPoDLLYLKRq+1ilsEF/wgBEOMhdZkvzUYjHc7ylpHuELCRb24FQJ IzQWzO04JHTP5UeRXqQYsylC6Vrrx3q9KAumOIYQfyPoAFwMQGpaaNLiipTtug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729004729; 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=l9L1zWuIOtr6/uJp/YEvAs2GP4I1uOR8adR1NSwJ5qQ=; b=RxW5FvX1AHmC1POmNXGkF/K11EcPTZJ8gHWwpCZtjDrtMpbaQq9yPYIMOW8fljvskMS5Qo CcgEuxXlNBb6To9MOrtIgDWkFAr61v3VtE5TWB9KjIscl6hS74KSJ92t+FxIVftgJa3Ni/ jKo6UH9+YPorkDsKxc5EbsEHdT3zgViENwQy3mmCU1AfHe261sbkId2wDRvxuKN/Uyt3Ut QCR99+dHmQDKSOXQjsNjY55v/qNw8XBGWROV0f1NUa7+zBDDyVho9XCTlw7B5QNwEKpmFN fntzgZ92HmCVZGUfKNA2EZc1hDV45brgL7Xgzd9tka4QifunQFfkA7tfe7zENQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729004729; a=rsa-sha256; cv=none; b=gPI5BfVh7zVnSYYN8vRLt7GC89TVHAJygEzR4FCuY1QMpEOLox+zl+bBXD0bM6WwHwPnwg FFjXDpPPicV9dYIQhymlmZQ7Hwgq1tZHscGUY6uahVpOKn7pbS7xsFM3nrXzdbAexhHWAF WWOb+bXd/sV8+Xk7t2zRxBnkbjN0KOod4bIn3KyHngdKXMY6ROLeKdQuX+mPYkc/4O7YbE pyf8GiHCaV6qhmQ7uanyID22AFdzX801XjF86MSmSD50NNg0kq11ll27ENKpUd9oq26usn ZGGhRLCJq7+HOUdjr69nScoPyPC/33eaJBAmHwYFxeoA/0eiXX4yPj8/BsUJ0A== 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 4XScpx5byDzRfc; Tue, 15 Oct 2024 15:05:29 +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 49FF5TBn089422; Tue, 15 Oct 2024 15:05:29 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49FF5Tt7089419; Tue, 15 Oct 2024 15:05:29 GMT (envelope-from git) Date: Tue, 15 Oct 2024 15:05:29 GMT Message-Id: <202410151505.49FF5Tt7089419@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Konstantin Belousov Subject: git: a1ae801880ef - stable/14 - 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/stable/14 X-Git-Reftype: branch X-Git-Commit: a1ae801880ef64e2c2fd7ca51744ff86611df313 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=a1ae801880ef64e2c2fd7ca51744ff86611df313 commit a1ae801880ef64e2c2fd7ca51744ff86611df313 Author: Konstantin Belousov AuthorDate: 2024-10-07 07:49:43 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-15 14:50:16 +0000 kinfo_vmentry: report max protection (cherry picked from commit 409c2fa385aa34baf7dd86bed2e86fbff16ad86d) --- 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 d20fc0ac4e9a..17d002a29c77 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2679,6 +2679,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 47f2984b1eff..4ca80741ad5a 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -508,6 +508,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