diff options
author | Alexey Dobriyan <adobriyan@gmail.com> | 2009-02-20 09:04:33 -0500 |
---|---|---|
committer | Alexey Dobriyan <adobriyan@gmail.com> | 2009-03-30 17:14:27 -0400 |
commit | 3dec7f59c370c7b58184d63293c3dc984d475840 (patch) | |
tree | 54df7ab53c1f625179e2b69c78b782b5a867363e /fs/proc/inode.c | |
parent | 09729a9919fdaf137995b0f19cbd401e22229cac (diff) |
proc 1/2: do PDE usecounting even for ->read_proc, ->write_proc
struct proc_dir_entry::owner is going to be removed. Now it's only necessary
to protect PDEs which are using ->read_proc, ->write_proc hooks.
However, ->owner assignments are racy and make it very easy for someone to switch
->owner on live PDE (as some subsystems do) without fixing refcounts and so on.
http://bugzilla.kernel.org/show_bug.cgi?id=12454
So, ->owner is on death row.
Proxy file operations exist already (proc_file_operations), just bump usecount
when necessary.
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Diffstat (limited to 'fs/proc/inode.c')
-rw-r--r-- | fs/proc/inode.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c index d8bb5c671f42..e11dc22c6511 100644 --- a/fs/proc/inode.c +++ b/fs/proc/inode.c | |||
@@ -127,7 +127,7 @@ static void __pde_users_dec(struct proc_dir_entry *pde) | |||
127 | complete(pde->pde_unload_completion); | 127 | complete(pde->pde_unload_completion); |
128 | } | 128 | } |
129 | 129 | ||
130 | static void pde_users_dec(struct proc_dir_entry *pde) | 130 | void pde_users_dec(struct proc_dir_entry *pde) |
131 | { | 131 | { |
132 | spin_lock(&pde->pde_unload_lock); | 132 | spin_lock(&pde->pde_unload_lock); |
133 | __pde_users_dec(pde); | 133 | __pde_users_dec(pde); |