Race conditions
Konstantin Belousov
kostikbel at gmail.com
Thu Sep 3 09:47:33 UTC 2015
On Wed, Sep 02, 2015 at 10:59:12AM -0700, John Baldwin wrote:
> If we allow a cdevsw to override how devname works, then that would probably
> be sufficient on its own. I don't think you would need to change the
> /dev/tapX devices at all. The cdevpriv for /dev/tap desciptors would have a
> reference to the /dev/tapX device it is using and return that device's name
> in the devname override.
You mean, the consumers of tap use fdevname(3), not devname(3) ? Since
for devname(), there is no access to cdevpriv.
>
> Another option that I had started to play with previously is to let devices
> auto-created by /dev/tap set an internal 'destroy-on-close' flag. That
> seems a bit more heavyweight, but it might also be simpler to implement?
Could you, please, clarify, how this would help to handle the race at
open ?
More information about the freebsd-drivers
mailing list