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

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