Commit 08194fb2 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] /proc data corruption check

From: Arjan van de Ven <arjanv@redhat.com>

If someone removes a /proc directory which still has subdirectories it will
lead to very nasty things (dentries remaining on hash chains etc etc etc).
The BUG_ON in the patch below will catch this nasty situation.
parent 644a73eb
...@@ -661,6 +661,7 @@ void remove_proc_entry(const char *name, struct proc_dir_entry *parent) ...@@ -661,6 +661,7 @@ void remove_proc_entry(const char *name, struct proc_dir_entry *parent)
proc_alloc_map); proc_alloc_map);
proc_kill_inodes(de); proc_kill_inodes(de);
de->nlink = 0; de->nlink = 0;
WARN_ON(de->subdir);
if (!atomic_read(&de->count)) if (!atomic_read(&de->count))
free_proc_entry(de); free_proc_entry(de);
else { else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment