git: 692c271beb8a - stable/13 - vfs: fix vnode use count leak in O_EMPTY_PATH support
Mateusz Guzik
mjg at FreeBSD.org
Tue May 18 06:04:16 UTC 2021
The branch stable/13 has been updated by mjg:
URL: https://cgit.FreeBSD.org/src/commit/?id=692c271beb8a14a5a142faf4a1d3f8832347b041
commit 692c271beb8a14a5a142faf4a1d3f8832347b041
Author: Mateusz Guzik <mjg at FreeBSD.org>
AuthorDate: 2021-05-13 09:23:03 +0000
Commit: Mateusz Guzik <mjg at FreeBSD.org>
CommitDate: 2021-05-18 06:04:00 +0000
vfs: fix vnode use count leak in O_EMPTY_PATH support
The vnode returned by namei_setup is already referenced.
Reported by: pho
(cherry picked from commit cef8a95acbae0c3043d95028d8ebb24d959a82a0)
---
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;
More information about the dev-commits-src-branches
mailing list