linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* BUG? a suspected race bug at alloc_fd()
@ 2009-08-07  4:55 홍신 shin hong
  2009-08-07 11:08 ` Matthew Wilcox
  0 siblings, 1 reply; 2+ messages in thread
From: 홍신 shin hong @ 2009-08-07  4:55 UTC (permalink / raw)
  To: linux-fsdevel

Hi.  I am reporting a suspected race bug at alloc_fd() in Linux 2.6.30.4.

In alloc_fd(), spin_lock(&files->file_lock) synchronizes
the execution of its gurading code block(line 448~486 at fs/file.c).

However, by invocation of expand_files() at line 458,
spin_lock(&file->file_lock) can be released and re-taken
since expand_files() invokes expand_fdtable() and expand_fdtable()
release &files->file_lock and re-take the lock (line 206~208).

For this reason, the execution of alloc_fd() might result race condition
if other threads are scheduled between the lock releasing and re-taking.

Please examine the code and let me know your opinion.
Thank you.

Sincerely
Shin Hong

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-08-07 11:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-08-07  4:55 BUG? a suspected race bug at alloc_fd() 홍신 shin hong
2009-08-07 11:08 ` Matthew Wilcox

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).