data race in remove_proc_entry()
Hi. I found a suspected bug in proc file system
At proc/generic.c line 806, de->subdir is not protected by spin_lock(&proc_subdir_lock)
so that data races might occur.
Line 806 must be protected by spin_lock(&proc_subdir_lock) to avoid data race.
WARN(condition , stmt) is translated into if (condition) { stmt }. At line 806, a context switching can happen right after the condition checking and another thread may set 'de->subdir' as a null.
In this case, the execution of 'stmt' would occur null pointer dereference error since it has 'de->subdir->name'.
Sincerely,
Shin HongM.S. Candidate
Computer Science Div., EECS Dept.,
Korea Advanced Institute of Sci. & Tech.,
Republic of Korea