diff options
author | rwatson <rwatson@FreeBSD.org> | 2004-01-07 17:58:51 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2004-01-07 17:58:51 +0000 |
commit | b3dbc3d2f9fe96fbf9beef99afe389f578d3d2ee (patch) | |
tree | fa55ea8e4f85909bfe2f57bb02f4845accf44dd9 /sys/fs/procfs/procfs.c | |
parent | 1bfb55e5d95e283a51c3972b29e78abe394254ca (diff) | |
download | FreeBSD-src-b3dbc3d2f9fe96fbf9beef99afe389f578d3d2ee.zip FreeBSD-src-b3dbc3d2f9fe96fbf9beef99afe389f578d3d2ee.tar.gz |
Lock p->p_textvp before calling vn_fullpath() on it. Note the
potential lock order concern due to the vnode lock held
simultaneously by the caller into procfs.
Reported by: kuriyama
Approved by: des
Diffstat (limited to 'sys/fs/procfs/procfs.c')
-rw-r--r-- | sys/fs/procfs/procfs.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/fs/procfs/procfs.c b/sys/fs/procfs/procfs.c index b950b58..309f0f2 100644 --- a/sys/fs/procfs/procfs.c +++ b/sys/fs/procfs/procfs.c @@ -70,7 +70,9 @@ procfs_doprocfile(PFS_FILL_ARGS) char *fullpath = "unknown"; char *freepath = NULL; + vn_lock(p->p_textvp, LK_EXCLUSIVE | LK_RETRY, td); vn_fullpath(td, p->p_textvp, &fullpath, &freepath); + VOP_UNLOCK(p->p_textvp, 0, td); sbuf_printf(sb, "%s", fullpath); if (freepath) free(freepath, M_TEMP); |