Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 22 Sep 2020 22:36:03 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r366020 - head/sys/kern
Message-ID:  <202009222236.08MMa3qQ059849@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: kib
Date: Tue Sep 22 22:36:02 2020
New Revision: 366020
URL: https://svnweb.freebsd.org/changeset/base/366020

Log:
  Only clear latch for BENEATH when we walk out of the startdir,
  
  not unconditionally on any dotdot component.
  
  Reviewed by:	markj
  Tested by:	pho
  Sponsored by:	The FreeBSD Foundation
  MFC after:	1 week
  Differential revision:	https://reviews.freebsd.org/D25886

Modified:
  head/sys/kern/vfs_lookup.c

Modified: head/sys/kern/vfs_lookup.c
==============================================================================
--- head/sys/kern/vfs_lookup.c	Tue Sep 22 22:23:58 2020	(r366019)
+++ head/sys/kern/vfs_lookup.c	Tue Sep 22 22:36:02 2020	(r366020)
@@ -238,13 +238,14 @@ nameicap_check_dotdot(struct nameidata *ndp, struct vn
 		return (ENOTCAPABLE);
 	TAILQ_FOREACH_REVERSE(nt, &ndp->ni_cap_tracker, nameicap_tracker_head,
 	    nm_link) {
+		if ((ndp->ni_lcf & NI_LCF_LATCH) != 0 &&
+		    ndp->ni_beneath_latch == nt->dp) {
+			ndp->ni_lcf &= ~NI_LCF_BENEATH_LATCHED;
+			nameicap_cleanup(ndp, false);
+			return (0);
+		}
 		if (dp == nt->dp)
 			return (0);
-	}
-	if ((ndp->ni_lcf & NI_LCF_BENEATH_ABS) != 0) {
-		ndp->ni_lcf &= ~NI_LCF_BENEATH_LATCHED;
-		nameicap_cleanup(ndp, false);
-		return (0);
 	}
 	return (ENOTCAPABLE);
 }



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