Blame SOURCES/autofs-5.1.1-fix-rwlock-unlock-crash.patch

019928
autofs-5.1.1 - fix rwlock unlock crash
019928
019928
From: Ian Kent <raven@themaw.net>
019928
019928
It should be the case that the only way that automount can exit
019928
the kernel communication read loop is after reading a packet and
019928
performing shutdown operations.
019928
019928
However there are reports of pthread_rwlock_unlock() being called
019928
from the exit cleanup function when the lock it is trying to unlock
019928
is not held.
019928
019928
But the call to the cleanup function is outside the communication
019928
loop so call it from each of the loop break points instead so that
019928
the expected locks must be held.
019928
019928
Signed-off-by: Ian Kent <raven@themaw.net>
019928
---
019928
 CHANGELOG          |    1 +
019928
 daemon/automount.c |    7 ++++---
019928
 2 files changed, 5 insertions(+), 3 deletions(-)
019928
019928
--- autofs-5.0.7.orig/CHANGELOG
019928
+++ autofs-5.0.7/CHANGELOG
019928
@@ -188,6 +188,7 @@
019928
 - fix typo in autofs.conf.
019928
 - always set direct mounts catatonic at exit.
019928
 - log pipe read errors.
019928
+- fix rwlock unlock crash.
019928
 
019928
 25/07/2012 autofs-5.0.7
019928
 =======================
019928
--- autofs-5.0.7.orig/daemon/automount.c
019928
+++ autofs-5.0.7/daemon/automount.c
019928
@@ -1773,6 +1773,7 @@ void *handle_mounts(void *arg)
019928
 			 */
019928
 			if (ap->type == LKP_DIRECT) {
019928
 				umount_autofs(ap, NULL, 1);
019928
+				handle_mounts_cleanup(ap);
019928
 				break;
019928
 			}
019928
 
019928
@@ -1783,8 +1784,10 @@ void *handle_mounts(void *arg)
019928
 			 * occurs while we're trying to umount.
019928
 			 */
019928
 			ret = umount_autofs(ap, NULL, 1);
019928
-			if (!ret)
019928
+			if (!ret) {
019928
+				handle_mounts_cleanup(ap);
019928
 				break;
019928
+			}
019928
 
019928
 			/* Failed shutdown returns to ready */
019928
 			warn(ap->logopt,
019928
@@ -1805,8 +1808,6 @@ void *handle_mounts(void *arg)
019928
 		}
019928
 	}
019928
 
019928
-	handle_mounts_cleanup(ap);
019928
-
019928
 	return NULL;
019928
 }
019928