From nobody Tue Oct 08 12:39:22 2024 X-Original-To: dev-commits-src-main@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 4XNFvZ3ppQz5ZNck; Tue, 08 Oct 2024 12:39:22 +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 4XNFvZ3GPMz4bgb; Tue, 8 Oct 2024 12:39:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728391162; 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=YJ8vS3tnLAu5KuV4aBsR1gikYu3zJk8CQY6/+qeEQK8=; b=bFgdgk3eOxe0H10N0UkMTpVhWsJAZMfGAcGb/9wnDFJk1QruRAomhBlllkjPY9cwi/QxTM JvfI6oGqfsUHyrGxYf9vudE7taG/SyPeeDZXFuUz8C7+dUlw511iXQ2DQy26xBP1Te3WTN VFsaiSYOmaOWef1mU0ZaMwoKnNw/a6HYRHRrPwtb44U0Ba5mSzJShBtNR4dVgQIlZI2E9t VtIqRzP3zJY9fHUQwigmLEgscCid7uNP+pTRLsO1nfP0yb1syFiyNEX6IxzmU0mTjd+E2L kHzy8EsA/aMjtFQVeOkTCm5J9b+A5V0fk4FmJuH95Zzaeq+j534sAlmsRCpMfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1728391162; 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=YJ8vS3tnLAu5KuV4aBsR1gikYu3zJk8CQY6/+qeEQK8=; b=E4JvkpFHpJFRkA7LpAnC3P5SRMQryySlZIha49AjaErPzE0DzVWhWLDcSqu2kgqaSN5+XU LUKRmJ+AQhDF/+lPA/iHp6K9ukLsslkNa7E06xOcohBA+722xMriJH1aQ/KGadbHuEbWSh +LdibhmtWj/mJq2H7jpMLd0EWOIP4BBoCcZac3i753cNMsZAE+wbmoeS5Xj7PnZcJLyXzm 8jqrvP9vVp3/LwVcUmFffrfMsqca9RLB0XsyDhwwTX9ZvtU/lXTH2CtqnG29qh/MT5sUKu 2wrRpYOEyAqJ698dh63fxmm+3sPA/exc7VbWgcVJ6pEc4J4siLIZDU9lR88V0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1728391162; a=rsa-sha256; cv=none; b=Kk2SI3VHYWYZ1RJj7sv+z/aMF9qj7SXJQFdVDxe2Na/loVAWiNYhRntiPOjobJNBV1wmZY uADJMW0CYjy7HvKrTuaGdbihydr1/KbcFIDLwMNHcItfNZeaVihNSfx92ou9UdRNMijlGB bQ+XDX8Uan1U+fxRIby6kcuArmQVdTNczZ6ivGnZTVQTvEsLCvgDdel0YADqHJij7lDdz1 YZ7VjIrNMOC5BUS8mVnmQLPOlBCsut0NdC0rgEOZLh64cDSnyNWJ1VhBXTQZKxOmm5Ep19 NLTjhMArwO/qRS2qFkYE7sijDNCtXUGqZ00BNHnjCnROGFTRx47SdpBBzTbLMA== 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 4XNFvZ2jCyzVJG; Tue, 8 Oct 2024 12:39:22 +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 498CdMOQ012838; Tue, 8 Oct 2024 12:39:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 498CdMn0012835; Tue, 8 Oct 2024 12:39:22 GMT (envelope-from git) Date: Tue, 8 Oct 2024 12:39:22 GMT Message-Id: <202410081239.498CdMn0012835@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: 71a66883b58f - main - kinfo_{vmobject,vmentry}: move copy of pathes into the vnode handling scope List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@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: 71a66883b58f796baf2bf79a43a91c16a71673b3 Auto-Submitted: auto-generated The branch main has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=71a66883b58f796baf2bf79a43a91c16a71673b3 commit 71a66883b58f796baf2bf79a43a91c16a71673b3 Author: Konstantin Belousov AuthorDate: 2024-10-07 07:36:51 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-08 12:37:47 +0000 kinfo_{vmobject,vmentry}: move copy of pathes into the vnode handling scope Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D46970 --- sys/kern/kern_proc.c | 7 +++---- sys/vm/vm_object.c | 5 ++--- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c index 422873ee14c2..7dc58b1e9bc9 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2740,6 +2740,9 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) kve->kve_status = KF_ATTR_VALID; } vput(vp); + strlcpy(kve->kve_path, fullpath, sizeof( + kve->kve_path)); + free(freepath, M_TEMP); } } else { kve->kve_type = guard ? KVME_TYPE_GUARD : @@ -2748,10 +2751,6 @@ kern_proc_vmmap_out(struct proc *p, struct sbuf *sb, ssize_t maxlen, int flags) kve->kve_shadow_count = 0; } - strlcpy(kve->kve_path, fullpath, sizeof(kve->kve_path)); - if (freepath != NULL) - free(freepath, M_TEMP); - /* Pack record size down */ if ((flags & KERN_VMMAP_PACK_KINFO) != 0) kve->kve_structsize = diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index 85fc27d169d6..6b9f89790ccd 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -2611,11 +2611,10 @@ vm_object_list_handler(struct sysctl_req *req, bool swap_only) /* truncate */ } vput(vp); + strlcpy(kvo->kvo_path, fullpath, sizeof(kvo->kvo_path)); + free(freepath, M_TEMP); } - strlcpy(kvo->kvo_path, fullpath, sizeof(kvo->kvo_path)); - free(freepath, M_TEMP); - /* Pack record size down */ kvo->kvo_structsize = offsetof(struct kinfo_vmobject, kvo_path) + strlen(kvo->kvo_path) + 1;