git: 512efd236cb1 - stable/12 - nameicap_tracker_add: avoid duplicates in the tracker list

Konstantin Belousov kib at FreeBSD.org
Sun Mar 21 17:55:17 UTC 2021


The branch stable/12 has been updated by kib:

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

commit 512efd236cb1aeeac591b1e5701fb1fe26d91a22
Author:     Konstantin Belousov <kib at FreeBSD.org>
AuthorDate: 2021-02-28 00:13:19 +0000
Commit:     Konstantin Belousov <kib at FreeBSD.org>
CommitDate: 2021-03-21 17:54:21 +0000

    nameicap_tracker_add: avoid duplicates in the tracker list
    
    Tested by:      pho
    
    (cherry picked from commit 2388ad7c293fbc89ee239a1adcb87fd158c4e8e9)
---
 sys/kern/vfs_lookup.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index cc0fe415365a..84a40d9e8fec 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -179,6 +179,9 @@ nameicap_tracker_add(struct nameidata *ndp, struct vnode *dp)
 	if ((ndp->ni_lcf & NI_LCF_CAP_DOTDOT) == 0 || dp->v_type != VDIR)
 		return;
 	cnp = &ndp->ni_cnd;
+	nt = TAILQ_LAST(&ndp->ni_cap_tracker, nameicap_tracker_head);
+	if (nt != NULL && nt->dp == dp)
+		return;
 	nt = uma_zalloc(nt_zone, M_WAITOK);
 	vhold(dp);
 	nt->dp = dp;


More information about the dev-commits-src-all mailing list