lkml.org 
[lkml]   [2005]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [Security] [vendor-sec] [BUG/PATCH/RFC] Oops while completing async USB via usbdevio


On Thu, 13 Oct 2005, Pete Zaitcev wrote:
>
> The whole application cannot exit and leave URBs running behind,
> because usbdevio_release() blocks until they are terminated.

Wrong.

You just do a fork(), and a close in the parent.

"release()" won't be called until the _last_ close, and the task that
opened the fd can certainly exit before that.

If you want to have something that is called on each close, you can
trigger on the "flush()" VFS call, but then you have to realize that that
can happen an infinite number of times, and while the original one is open
(ie on a fork, if the _child_ calls close(), then you'll get a flush, even
though the original fd is still open and still in use).

So you really don't want to terminate the URB's in "flush()". Which means
that the original process can very much be long gone when release happens.

It's a fundamental mistake to think that file descriptors stay with the
process that opened them.

Linus
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2009-11-18 23:46    [W:0.178 / U:0.148 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site