public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] debugfs: fix double unlock in open_proxy_open()
@ 2016-03-12 15:09 Nicolai Stange
  2016-03-12 15:20 ` Nicolai Stange
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nicolai Stange @ 2016-03-12 15:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Rasmus Villemoes, linux-kernel, Nicolai Stange

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] debugfs: fix double unlock in open_proxy_open()
  2016-03-12 15:09 [PATCH] debugfs: fix double unlock in open_proxy_open() Nicolai Stange
@ 2016-03-12 15:20 ` Nicolai Stange
  2016-03-12 15:22 ` Nicolai Stange
  2016-03-22 13:15 ` Nicolai Stange
  2 siblings, 0 replies; 4+ messages in thread
From: Nicolai Stange @ 2016-03-12 15:20 UTC (permalink / raw)
  To: Nicolai Stange; +Cc: Greg Kroah-Hartman, Rasmus Villemoes, linux-kernel

Nicolai Stange <nicstange@gmail.com> writes:

> 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.


This one has been reported by Rasmus Villemoes:

  http://lkml.kernel.org/g/87d1r2uh95.fsf@rasmusvillemoes.dk


Thank you very much!

Nicolai

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] debugfs: fix double unlock in open_proxy_open()
  2016-03-12 15:09 [PATCH] debugfs: fix double unlock in open_proxy_open() Nicolai Stange
  2016-03-12 15:20 ` Nicolai Stange
@ 2016-03-12 15:22 ` Nicolai Stange
  2016-03-22 13:15 ` Nicolai Stange
  2 siblings, 0 replies; 4+ messages in thread
From: Nicolai Stange @ 2016-03-12 15:22 UTC (permalink / raw)
  To: Nicolai Stange; +Cc: Greg Kroah-Hartman, Rasmus Villemoes, linux-kernel

Ah and sorry: applicable to the driver-core tree's driver-core-testing branch.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] debugfs: fix double unlock in open_proxy_open()
  2016-03-12 15:09 [PATCH] debugfs: fix double unlock in open_proxy_open() Nicolai Stange
  2016-03-12 15:20 ` Nicolai Stange
  2016-03-12 15:22 ` Nicolai Stange
@ 2016-03-22 13:15 ` Nicolai Stange
  2 siblings, 0 replies; 4+ messages in thread
From: Nicolai Stange @ 2016-03-22 13:15 UTC (permalink / raw)
  To: Nicolai Stange; +Cc: Greg Kroah-Hartman, Rasmus Villemoes, linux-kernel

Please drop as this has been fixed in the current v6 of the offending
series to be found here:

  http://lkml.kernel.org/g/1458652280-19785-1-git-send-email-nicstange@gmail.com

Thank you!

Nicolai

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-03-22 13:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-12 15:09 [PATCH] debugfs: fix double unlock in open_proxy_open() Nicolai Stange
2016-03-12 15:20 ` Nicolai Stange
2016-03-12 15:22 ` Nicolai Stange
2016-03-22 13:15 ` Nicolai Stange

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