Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Sep 2021 11:01:27 GMT
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 69ab52838655 - main - linprocfs: find cwd and root handling
Message-ID:  <202109301101.18UB1Rur009030@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mjg:

URL: https://cgit.FreeBSD.org/src/commit/?id=69ab52838655912cf89699e0b2d21d244d3b9b27

commit 69ab52838655912cf89699e0b2d21d244d3b9b27
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2021-09-30 10:50:18 +0000
Commit:     Mateusz Guzik <mjg@FreeBSD.org>
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 <damjan.jov@gmail.com>
---
 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);



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202109301101.18UB1Rur009030>