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
This commit is contained in:
Robert Watson 2004-01-07 17:58:51 +00:00
parent 1bc99f1144
commit 1f1ca35f69

View File

@ -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);