public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* fork/open race results in wasted fd
@ 2001-05-31 20:40 Brian J. Watson
  0 siblings, 0 replies; only message in thread
From: Brian J. Watson @ 2001-05-31 20:40 UTC (permalink / raw)
  To: Linux Kernel

Two tasks (A & B) share the same files_struct. A calls open() at the same time
as B calls fork(). After A runs get_unused_fd() but before it calls
fd_install(), B runs copy_files().

It looks like the result is one of the bits is set in B's open_fds field with no
corresponding file pointer in its fd array. The fd is unusable, and attempting
to close() it would return EBADF.

Is this a known race?

-Brian (please copy me in response)

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

only message in thread, other threads:[~2001-05-31 20:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-05-31 20:40 fork/open race results in wasted fd Brian J. Watson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox