Skip to content

Commit 43f14d8

Browse files
cyrillostorvalds
authored andcommitted
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>
1 parent d850a2f commit 43f14d8

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎fs/ecryptfs/miscdev.c‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,14 @@ ecryptfs_miscdev_read(struct file *file, char __user *buf, size_t count,
257257
mutex_lock(&daemon->mux);
258258
if (daemon->flags & ECRYPTFS_DAEMON_ZOMBIE) {
259259
rc = 0;
260+
mutex_unlock(&ecryptfs_daemon_hash_mux);
260261
printk(KERN_WARNING "%s: Attempt to read from zombified "
261262
"daemon\n", __func__);
262263
goto out_unlock_daemon;
263264
}
264265
if (daemon->flags & ECRYPTFS_DAEMON_IN_READ) {
265266
rc = 0;
267+
mutex_unlock(&ecryptfs_daemon_hash_mux);
266268
goto out_unlock_daemon;
267269
}
268270
/* This daemon will not go away so long as this flag is set */

0 commit comments

Comments
 (0)