From nobody Tue Oct 15 15:05:25 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 4XScps4xzxz5YYW7; Tue, 15 Oct 2024 15:05:25 +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 4XScps2RzNz45vC; Tue, 15 Oct 2024 15:05:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729004725; 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=EuxssdT1mhZMsRWY21G+ptHUTABELNwQNsmUWvirGiE=; b=yDjACx3FgOxQm1WG0T+it4i3oP1Axg086QE9I3MrePcGSxOKMRGEqzEiVv7KGOsAPL5r4C XiDvqw4qt0wdv8ZwO8B8c6WZIstqH+c7Pm93qwL7xsOSppApEmhrnFY4doZ81sPFRLYhaz 2FDDIKGCB9Eww/YHfYQo87Zx9xgpRKKJ62tMpDNIfzodMrkuPRJOu5kJt4VcHFz9DJhDjC Bi5Xej0s2atXPbkxXO/SPgB4tx0nZXMl6kMuUh9fl85V5rVFqvy5Es41UFrAHGRM/Ktv2C ZFIhphP0wX7NVwKfbqvEyaXY4HgfGxW0YF5QoLhwNicAQGDEjX0HSXHqTEjubw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729004725; 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=EuxssdT1mhZMsRWY21G+ptHUTABELNwQNsmUWvirGiE=; b=NBPOT+1xYExjowjugZGERlNSKEGbC/24V4o2Ekj+nW+nYFEqHjNz3zeiuKf65Y87nExJvw tOFcL7yJoEfXOA0YnWtmDKVMfXn2waaX0x/+AhhkWvNtzR3dR9FGcsr0IWhIKoNJ7MzCZF kw26FTgGvj26gxW6HaZzhkO/+3OySGQjD2hYYpaR4kh2lOcfdCL+R3JZAiAfupokhkYO4V 2tRG3FcoAjl+FnJjbH+atOS3d0wTzmBRD+4z/26fzDfcEKOvG1CE1nFatFLjW7zUpAh/VV B37fp2GXjFRw3NbKrmJe2UMoLfhf6UbJIN5gq2FClWf09YyI4luv8Rp7dFht/w== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729004725; a=rsa-sha256; cv=none; b=N0SQlypp4CQNvnBUq8m/XTXWibgmwWCFds5aNeWbdFNGvl73Y0IfOt42v/qDh1SXiw72RK 3MGbC3qgDllWIDOAVm48UMWtNbd8efKSTZnit7OYegwOX/f7UfaboWCzSK+7RG90wr7GU0 q1nGmHSK8veyV7tirB+y9wh7U6Pc6TvlAMNubUxPyMqeEPVBLxpPAfRSkHj1We2EPTIyi2 FMYKJv65Bokafj3NXLxOxKjZE5nEPfgDVTswrOVmKWEt4C6lagEDTuq2mkBQXro8VSnQfC UuPXN2bfmuuMIYi42miNp5V7QZGfgj0iaQILGUWyHr030c+b8RXjbSlN20mBsQ== 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 4XScps1nPmzRfb; Tue, 15 Oct 2024 15:05:25 +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 49FF5PBw089223; Tue, 15 Oct 2024 15:05:25 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49FF5Pbt089220; Tue, 15 Oct 2024 15:05:25 GMT (envelope-from git) Date: Tue, 15 Oct 2024 15:05:25 GMT Message-Id: <202410151505.49FF5Pbt089220@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: ba8062dc2280 - stable/14 - kinfo_vmentry: report mappings of the SysV shm segments 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: ba8062dc22805089e69a8b47e0a15c50ae35f007 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=ba8062dc22805089e69a8b47e0a15c50ae35f007 commit ba8062dc22805089e69a8b47e0a15c50ae35f007 Author: Konstantin Belousov AuthorDate: 2024-10-05 09:15:12 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-15 14:50:16 +0000 kinfo_vmentry: report mappings of the SysV shm segments (cherry picked from commit d3dd6bd4039573eb74cd77da5b92e68b04296888) --- sys/kern/kern_proc.c | 10 ++++++++++ sys/sys/user.h | 1 + 2 files changed, 11 insertions(+) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index b52455f140b2..d20fc0ac4e9a 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -44,6 +44,7 @@ #include #include #include +#include #include #include #include @@ -62,6 +63,7 @@ #include #include #include +#include #include #include #include @@ -2616,6 +2618,8 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) vm_offset_t addr; unsigned int last_timestamp; int error; + key_t key; + unsigned short seq; bool guard, super; PROC_LOCK_ASSERT(p, MA_OWNED); @@ -2706,6 +2710,12 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) kve->kve_ref_count = obj->ref_count; kve->kve_shadow_count = obj->shadow_count; VM_OBJECT_RUNLOCK(obj); + if ((lobj->flags & OBJ_SYSVSHM) != 0) { + kve->kve_flags |= KVME_FLAG_SYSVSHM; + shmobjinfo(lobj, &key, &seq); + kve->kve_vn_fileid = key; + kve->kve_vn_fsid_freebsd11 = seq; + } if (vp != NULL) { vn_fullpath(vp, &fullpath, &freepath); kve->kve_vn_type = vntype_to_kinfo(vp->v_type); diff --git a/sys/sys/user.h b/sys/sys/user.h index bd460d452bcc..70592eb44668 100644 --- a/sys/sys/user.h +++ b/sys/sys/user.h @@ -516,6 +516,7 @@ struct kinfo_lockf { #define KVME_FLAG_GROWS_UP 0x00000010 #define KVME_FLAG_GROWS_DOWN 0x00000020 #define KVME_FLAG_USER_WIRED 0x00000040 +#define KVME_FLAG_SYSVSHM 0x00000080 #if defined(__amd64__) #define KINFO_OVMENTRY_SIZE 1168