]> git.karo-electronics.de Git - karo-tx-linux.git/commit
debugfs: fix create mutex racy fops and private data
authorMathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Tue, 17 Nov 2009 22:40:26 +0000 (14:40 -0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 18 Dec 2009 21:43:20 +0000 (13:43 -0800)
commitf4173b24e1f6072177cf2354bb9e4337c99f4fa6
tree7dcb44c66427fd872f744f64f67686200bec81cc
parent946b3840c95bab8ef96de7b1f6f738eb9ec08373
debugfs: fix create mutex racy fops and private data

commit d3a3b0adad0865c12e39b712ca89efbd0a3a0dbc upstream.

Setting fops and private data outside of the mutex at debugfs file
creation introduces a race where the files can be opened with the wrong
file operations and private data.  It is easy to trigger with a process
waiting on file creation notification.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/debugfs/inode.c