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, 11 Dec 2009 19:24:53 +0000 (11:24 -0800)
commitd3a3b0adad0865c12e39b712ca89efbd0a3a0dbc
tree31a8363a2e908d65514aa8f176ecfa7e57fc8f2a
parent18ef545e47c126abd87c013b762b5fbb574858ce
debugfs: fix create mutex racy fops and private data

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>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
fs/debugfs/inode.c