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:
parent
1bc99f1144
commit
1f1ca35f69
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user