public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] eCryptFS: fix imbalanced mutex locking
@ 2008-05-10  8:45 Cyrill Gorcunov
  0 siblings, 0 replies; only message in thread
From: Cyrill Gorcunov @ 2008-05-10  8:45 UTC (permalink / raw)
  To: Michael A. Halcrow; +Cc: Ingo Molnar, LKML

Fix imbalanced calls for mutex lock/unlock on ecryptfs_daemon_hash_mux

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---

Revealed by Ingo Molnar: http://lkml.org/lkml/2008/5/7/260

Please test and rewview

Index: linux-2.6.git/fs/ecryptfs/miscdev.c
===================================================================
--- linux-2.6.git.orig/fs/ecryptfs/miscdev.c	2008-04-29 22:56:53.000000000 +0400
+++ linux-2.6.git/fs/ecryptfs/miscdev.c	2008-05-10 12:40:22.000000000 +0400
@@ -257,12 +257,14 @@ ecryptfs_miscdev_read(struct file *file,
 	mutex_lock(&daemon->mux);
 	if (daemon->flags & ECRYPTFS_DAEMON_ZOMBIE) {
 		rc = 0;
+		mutex_unlock(&ecryptfs_daemon_hash_mux);
 		printk(KERN_WARNING "%s: Attempt to read from zombified "
 		       "daemon\n", __func__);
 		goto out_unlock_daemon;
 	}
 	if (daemon->flags & ECRYPTFS_DAEMON_IN_READ) {
 		rc = 0;
+		mutex_unlock(&ecryptfs_daemon_hash_mux);
 		goto out_unlock_daemon;
 	}
 	/* This daemon will not go away so long as this flag is set */

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-10  8:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-10  8:45 [PATCH] eCryptFS: fix imbalanced mutex locking Cyrill Gorcunov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox