From owner-dev-commits-src-main@freebsd.org Thu Sep 30 11:01:27 2021 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id F08F36AFAA8; Thu, 30 Sep 2021 11:01:27 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HKr076MFWz3Gk1; Thu, 30 Sep 2021 11:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) 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 BB5872A88; Thu, 30 Sep 2021 11:01:27 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 18UB1RGX009031; Thu, 30 Sep 2021 11:01:27 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 18UB1Rur009030; Thu, 30 Sep 2021 11:01:27 GMT (envelope-from git) Date: Thu, 30 Sep 2021 11:01:27 GMT Message-Id: <202109301101.18UB1Rur009030@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Mateusz Guzik Subject: git: 69ab52838655 - main - linprocfs: find cwd and root handling MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mjg X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 69ab52838655912cf89699e0b2d21d244d3b9b27 Auto-Submitted: auto-generated X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Commit messages for the main branch of the src repository List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 30 Sep 2021 11:01:28 -0000 The branch main has been updated by mjg: URL: https://cgit.FreeBSD.org/src/commit/?id=69ab52838655912cf89699e0b2d21d244d3b9b27 commit 69ab52838655912cf89699e0b2d21d244d3b9b27 Author: Mateusz Guzik AuthorDate: 2021-09-30 10:50:18 +0000 Commit: Mateusz Guzik CommitDate: 2021-09-30 10:59:58 +0000 linprocfs: find cwd and root handling The code would incorrectly use curthread instead of the target proc to resolve vnodes. Fixes: 8d03b99b9dafe928 ("fd: move vnodes out of filedesc into a dedicated structure") PR: 258729 Noted by: Damjan Jovanovic --- sys/compat/linprocfs/linprocfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/compat/linprocfs/linprocfs.c b/sys/compat/linprocfs/linprocfs.c index ae5823d96fdf..18dec7e01aae 100644 --- a/sys/compat/linprocfs/linprocfs.c +++ b/sys/compat/linprocfs/linprocfs.c @@ -1169,7 +1169,7 @@ linprocfs_doproccwd(PFS_FILL_ARGS) char *fullpath = "unknown"; char *freepath = NULL; - pwd = pwd_hold(td); + pwd = pwd_hold_proc(p); vn_fullpath(pwd->pwd_cdir, &fullpath, &freepath); sbuf_printf(sb, "%s", fullpath); if (freepath) @@ -1189,7 +1189,7 @@ linprocfs_doprocroot(PFS_FILL_ARGS) char *fullpath = "unknown"; char *freepath = NULL; - pwd = pwd_hold(td); + pwd = pwd_hold_proc(p); vp = jailed(p->p_ucred) ? pwd->pwd_jdir : pwd->pwd_rdir; vn_fullpath(vp, &fullpath, &freepath); sbuf_printf(sb, "%s", fullpath);