Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 May 2021 06:04:16 GMT
From:      Mateusz Guzik <mjg@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: 692c271beb8a - stable/13 - vfs: fix vnode use count leak in O_EMPTY_PATH support
Message-ID:  <202105180604.14I64Gb8059079@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by mjg:

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

commit 692c271beb8a14a5a142faf4a1d3f8832347b041
Author:     Mateusz Guzik <mjg@FreeBSD.org>
AuthorDate: 2021-05-13 09:23:03 +0000
Commit:     Mateusz Guzik <mjg@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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105180604.14I64Gb8059079>