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

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