public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Nicolai Stange <nicstange@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	linux-kernel@vger.kernel.org,
	Nicolai Stange <nicstange@gmail.com>
Subject: [PATCH] debugfs: fix double unlock in open_proxy_open()
Date: Sat, 12 Mar 2016 16:09:05 +0100	[thread overview]
Message-ID: <1457795345-23014-1-git-send-email-nicstange@gmail.com> (raw)

In case an open is racing with a debugfs file removal, the corresponding
error path in open_proxy_open() releases its SRCU read side critical
section twice, i.e. it does a double unlock.

Fix that by purging the extra unlock operation.

Signed-off-by: Nicolai Stange <nicstange@gmail.com>
---
 fs/debugfs/file.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
index 6a4b667..9c1c9a0 100644
--- a/fs/debugfs/file.c
+++ b/fs/debugfs/file.c
@@ -108,7 +108,6 @@ static int open_proxy_open(struct inode *inode, struct file *filp)
 
 	r = debugfs_use_file_start(dentry, &srcu_idx);
 	if (r) {
-		debugfs_use_file_finish(srcu_idx);
 		r = -ENOENT;
 		goto out;
 	}
-- 
2.7.2

             reply	other threads:[~2016-03-12 15:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-12 15:09 Nicolai Stange [this message]
2016-03-12 15:20 ` [PATCH] debugfs: fix double unlock in open_proxy_open() Nicolai Stange
2016-03-12 15:22 ` Nicolai Stange
2016-03-22 13:15 ` Nicolai Stange

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=1457795345-23014-1-git-send-email-nicstange@gmail.com \
    --to=nicstange@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox