diff options
author | Alexey Dobriyan <adobriyan@openvz.org> | 2007-05-08 03:25:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-08 14:15:01 -0400 |
commit | 7695650a924a6859910c8c19dfa43b4d08224d66 (patch) | |
tree | 5947c3e1b24600b6440468c11b30feeef31eee2c /include/linux/proc_fs.h | |
parent | 79c0b2df79eb56fc71e54c75cd7fb3acf84370f9 (diff) |
Fix race between proc_get_inode() and remove_proc_entry()
proc_lookup remove_proc_entry
=========== =================
lock_kernel();
spin_lock(&proc_subdir_lock);
[find PDE with refcount 0]
spin_unlock(&proc_subdir_lock);
spin_lock(&proc_subdir_lock);
[find PDE with refcount 0]
[check refcount and free PDE]
spin_unlock(&proc_subdir_lock);
proc_get_inode:
de_get(de); /* boom */
Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/proc_fs.h')
-rw-r--r-- | include/linux/proc_fs.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index f4f7a63cae1f..3469f96bc8b2 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -106,6 +106,9 @@ int task_statm(struct mm_struct *, int *, int *, int *, int *); | |||
106 | char *task_mem(struct mm_struct *, char *); | 106 | char *task_mem(struct mm_struct *, char *); |
107 | void clear_refs_smap(struct mm_struct *mm); | 107 | void clear_refs_smap(struct mm_struct *mm); |
108 | 108 | ||
109 | struct proc_dir_entry *de_get(struct proc_dir_entry *de); | ||
110 | void de_put(struct proc_dir_entry *de); | ||
111 | |||
109 | extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, | 112 | extern struct proc_dir_entry *create_proc_entry(const char *name, mode_t mode, |
110 | struct proc_dir_entry *parent); | 113 | struct proc_dir_entry *parent); |
111 | extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); | 114 | extern void remove_proc_entry(const char *name, struct proc_dir_entry *parent); |