The branch main has been updated by mjg:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=cef8a95acbae0c3043d95028d8ebb24d959a82a0

commit cef8a95acbae0c3043d95028d8ebb24d959a82a0
Author:     Mateusz Guzik <m...@freebsd.org>
AuthorDate: 2021-05-13 09:23:03 +0000
Commit:     Mateusz Guzik <m...@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;
_______________________________________________
dev-commits-src-main@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-main
To unsubscribe, send any mail to "dev-commits-src-main-unsubscr...@freebsd.org"

Reply via email to