diff --git a/sys/compat/svr4/svr4_misc.c b/sys/compat/svr4/svr4_misc.c index 953a31d16bca..fea3608b4a1b 100644 --- a/sys/compat/svr4/svr4_misc.c +++ b/sys/compat/svr4/svr4_misc.c @@ -1600,12 +1600,14 @@ svr4_sys_resolvepath(td, uap) struct nameidata nd; int error, *retval = td->td_retval; unsigned int ncopy; + int vfslocked; - NDINIT(&nd, LOOKUP, NOFOLLOW | SAVENAME, UIO_USERSPACE, + NDINIT(&nd, LOOKUP, NOFOLLOW | SAVENAME | MPSAFE, UIO_USERSPACE, uap->path, td); if ((error = namei(&nd)) != 0) return error; + vfslocked = NDHASGIANT(&nd); ncopy = min(uap->bufsiz, strlen(nd.ni_cnd.cn_pnbuf) + 1); if ((error = copyout(nd.ni_cnd.cn_pnbuf, uap->buf, ncopy)) != 0) @@ -1615,5 +1617,6 @@ svr4_sys_resolvepath(td, uap) bad: NDFREE(&nd, NDF_ONLY_PNBUF); vput(nd.ni_vp); + VFS_UNLOCK_GIANT(vfslocked); return error; } diff --git a/sys/compat/svr4/syscalls.master b/sys/compat/svr4/syscalls.master index ba7af099b2fb..a5d6a945dbc0 100644 --- a/sys/compat/svr4/syscalls.master +++ b/sys/compat/svr4/syscalls.master @@ -320,7 +320,7 @@ 206 AUE_NULL UNIMPL schedctl 207 AUE_NULL UNIMPL pset 208 AUE_NULL UNIMPL whoknows -209 AUE_NULL STD { int svr4_sys_resolvepath(const char *path, \ +209 AUE_NULL MSTD { int svr4_sys_resolvepath(const char *path, \ char *buf, size_t bufsiz); } 210 AUE_NULL UNIMPL signotifywait 211 AUE_NULL UNIMPL lwp_sigredirect