Blame SOURCES/autofs-5.1.4-fix-incorrect-locking-in-sss-lookup.patch

aea863
autofs-5.1.4 - fix incorrect locking in sss lookup
aea863
aea863
From: Ian Kent <raven@themaw.net>
aea863
aea863
Commit 766e0f6c4, autofs-5.0.7 - fix fix wildcard multi map regression,
aea863
introduced a deadlock during restart when the sss modules is used.
aea863
aea863
Looking at the comment above the code which takes the lock it clearly
aea863
does this incorrectly.
aea863
aea863
Signed-off-by: Ian Kent <raven@themaw.net>
aea863
---
aea863
 CHANGELOG            |    1 +
aea863
 modules/lookup_sss.c |    4 ++--
aea863
 2 files changed, 3 insertions(+), 2 deletions(-)
aea863
aea863
--- autofs-5.1.4.orig/CHANGELOG
aea863
+++ autofs-5.1.4/CHANGELOG
aea863
@@ -34,6 +34,7 @@ xx/xx/2018 autofs-5.1.5
aea863
 - add master map pseudo options for mount propagation.
aea863
 - fix age setting at startup.
aea863
 - fix use after free in parse_ldap_config().
aea863
+- fix incorrect locking in sss lookup.
aea863
 
aea863
 19/12/2017 autofs-5.1.4
aea863
 - fix spec file url.
aea863
--- autofs-5.1.4.orig/modules/lookup_sss.c
aea863
+++ autofs-5.1.4/modules/lookup_sss.c
aea863
@@ -786,9 +786,9 @@ int lookup_mount(struct autofs_point *ap
aea863
 	 * when we're starting up so just take the readlock in that
aea863
 	 */
aea863
 	if (ap->flags & MOUNT_FLAG_REMOUNT)
aea863
-		cache_writelock(mc);
aea863
-	else
aea863
 		cache_readlock(mc);
aea863
+	else
aea863
+		cache_writelock(mc);
aea863
 	me = cache_lookup(mc, key);
aea863
 	/* Stale mapent => check for entry in alternate source or wildcard */
aea863
 	if (me && !me->mapent) {