From nobody Tue Oct 15 15:05:31 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 4XScq02Pwhz5Z3KW; Tue, 15 Oct 2024 15:05:32 +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 4XScq00FhGz46Cc; Tue, 15 Oct 2024 15:05:32 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729004732; 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=CRU1C658/uil6mfw0v56XTQZcRaTE2h34ba1Qs9VHfg=; b=X5PHDSnYVlapL6Y5pm6hmSFHZND8s7LyN4snsj/b95b1E9TF42HyVYsErPGBAGvSxoVEwW rsbDpFNT26y/HR2gkaEwxQV+WRbmzjdDVGid1m7CHtQe6NpOAZGxs2K6QzVkwHL6EHGEYB ZfFi16j7y1Q/O3WtAAd02nLe1XMdvcofB2VTv7dUgB9PLV9xFASWS3D2Gbwamfg+Wrqegy vJfnNUT2Ob50qyGaO6DCIyyvH1uzotnzltZxHTiCu1ekh9V6gw/TC1Qji1Hmosc8ItS1q/ qO+QOsHHPrjHuYRKCozpWrNBSo+4+o71yUgPJIOovhddBS5pt7ktVI7ySjv0Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1729004732; 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=CRU1C658/uil6mfw0v56XTQZcRaTE2h34ba1Qs9VHfg=; b=eCAt5/Majvi2eJi/1UMbbIauZHoQnhRH6ftLEvpdDwcVf6jrPZ2dSvMdCE4Hqnz4wqmXMR BZbCnCVcUttczs7TTaaia9KMlqqGS2dzlknSJ5kEymHfO6bDS6vIQwmHnVK/7VeWEuMjNL PTY4VurydLNnrFHFJgOCT2wCBScvQ9wtXJoGuc3LNDvbs/WEy/qaG35z+qhc9hHHN7MTO3 TvMnhZLUSJ1VbsA2ZGeo4ApjNPupH1RUxfnYewtnkFHPDpmTpCvCuerPqntHsyxWJYlnTh mWcxpp/5fguntIgvGKHKJsBQrPp48gFYrTtWkBmurQZq3XbXArdEQQjd4x8jUg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1729004732; a=rsa-sha256; cv=none; b=Sbs1a4ZT9mWwttyaoqPTuRD/HMPL6Ng1w3ijL00pKDK1UDibTBkFtxqY4IgdwR3DKkaFGM IkjfX80kmsJnN0YXul0Te5QBQF6+05TGvXxKG/aK3wlBdYSGeA71c5FJ7lPlCLVyaDs1tq TgkGi2Exg0FoJYdvrgTxzN1Dul80I++SMZIeyOkpPX6rHRQshP6qI0zJp+KuYjIVexXSGd 704BUlQP1vGqQdrLLmAH90O49k9zy34nuPFKaTCtxdCZojHQbglPEa2pF7Nr21A9GNrwLV GwGZRjeTU4I8kHSex+Pesx+pmVECM/QAPCrn3nScw5SWYdm/kBLhwixMuM8Fmw== 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 4XScpz6g3TzRRP; Tue, 15 Oct 2024 15:05:31 +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 49FF5Va8089518; Tue, 15 Oct 2024 15:05:31 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 49FF5VuK089515; Tue, 15 Oct 2024 15:05:31 GMT (envelope-from git) Date: Tue, 15 Oct 2024 15:05:31 GMT Message-Id: <202410151505.49FF5VuK089515@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: 987c8e9afa1a - stable/14 - kinfo_{vmobject,vmentry}: move copy of pathes into the vnode handling scope 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: 987c8e9afa1a198d7cf9fc304e4855a0d9dcb738 Auto-Submitted: auto-generated The branch stable/14 has been updated by kib: URL: https://cgit.FreeBSD.org/src/commit/?id=987c8e9afa1a198d7cf9fc304e4855a0d9dcb738 commit 987c8e9afa1a198d7cf9fc304e4855a0d9dcb738 Author: Konstantin Belousov AuthorDate: 2024-10-07 07:36:51 +0000 Commit: Konstantin Belousov CommitDate: 2024-10-15 14:50:16 +0000 kinfo_{vmobject,vmentry}: move copy of pathes into the vnode handling scope (cherry picked from commit 71a66883b58f796baf2bf79a43a91c16a71673b3) --- 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 17d002a29c77..8f5ffeea71d3 100644 --- a/sys/kern/kern_proc.c +++ b/sys/kern/kern_proc.c @@ -2741,6 +2741,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 : @@ -2749,10 +2752,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 a8821f0f2a8b..1dbebf139683 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -2622,11 +2622,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;