Commit 43f14d856f013a4cc63da2c765617c665274338c

Authored by Cyrill Gorcunov
Committed by Linus Torvalds
1 parent d850a2fac1

eCryptFS: fix imbalanced mutex locking

Fix imbalanced calls for mutex lock/unlock on ecryptfs_daemon_hash_mux
Revealed by Ingo Molnar: http://lkml.org/lkml/2008/5/7/260

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

fs/ecryptfs/miscdev.c
... ... @@ -257,12 +257,14 @@
257 257 mutex_lock(&daemon->mux);
258 258 if (daemon->flags & ECRYPTFS_DAEMON_ZOMBIE) {
259 259 rc = 0;
  260 + mutex_unlock(&ecryptfs_daemon_hash_mux);
260 261 printk(KERN_WARNING "%s: Attempt to read from zombified "
261 262 "daemon\n", __func__);
262 263 goto out_unlock_daemon;
263 264 }
264 265 if (daemon->flags & ECRYPTFS_DAEMON_IN_READ) {
265 266 rc = 0;
  267 + mutex_unlock(&ecryptfs_daemon_hash_mux);
266 268 goto out_unlock_daemon;
267 269 }
268 270 /* This daemon will not go away so long as this flag is set */