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

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