Date: Thu, 13 May 2021 09:39:41 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: cef8a95acbae - main - vfs: fix vnode use count leak in O_EMPTY_PATH support Message-ID: <202105130939.14D9dfBC050147@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=cef8a95acbae0c3043d95028d8ebb24d959a82a0 commit cef8a95acbae0c3043d95028d8ebb24d959a82a0 Author: Mateusz Guzik <mjg@FreeBSD.org> AuthorDate: 2021-05-13 09:23:03 +0000 Commit: Mateusz Guzik <mjg@FreeBSD.org> CommitDate: 2021-05-13 09:39:27 +0000 vfs: fix vnode use count leak in O_EMPTY_PATH support The vnode returned by namei_setup is already referenced. Reported by: pho --- sys/kern/vfs_lookup.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c index 3050275c1b6f..5336bf87ec68 100644 --- a/sys/kern/vfs_lookup.c +++ b/sys/kern/vfs_lookup.c @@ -495,8 +495,10 @@ namei_emptypath(struct nameidata *ndp) goto errout; } + /* + * Usecount on dp already provided by namei_setup. + */ ndp->ni_vp = dp; - vref(dp); namei_cleanup_cnp(cnp); pwd_drop(pwd); ndp->ni_resflags |= NIRES_EMPTYPATH;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105130939.14D9dfBC050147>