All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: "Michael A. Halcrow" <mhalcrow@us.ibm.com>
Cc: Ingo Molnar <mingo@elte.hu>, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] eCryptFS: fix imbalanced mutex locking
Date: Sat, 10 May 2008 12:45:09 +0400	[thread overview]
Message-ID: <20080510084509.GA6872@cvg> (raw)

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 */

                 reply	other threads:[~2008-05-10  8:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080510084509.GA6872@cvg \
    --to=gorcunov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhalcrow@us.ibm.com \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.