linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* data race in remove_proc_entry()
@ 2009-02-03 15:40 홍신 shin hong
  0 siblings, 0 replies; only message in thread
From: 홍신 shin hong @ 2009-02-03 15:40 UTC (permalink / raw)
  To: viro, linux-fsdevel

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 Hong
M.S. Candidate
Computer Science Div., EECS Dept.,
Korea Advanced Institute of Sci. & Tech.,
Republic of Korea

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-02-03 15:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-03 15:40 data race in remove_proc_entry() 홍신 shin hong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).