Page MenuHomeFreeBSD

tun(4): Don't allow open of open or dying devices
ClosedPublic

Authored by kevans on Apr 23 2019, 9:45 PM.
Tags
None
Referenced Files
F125499496: D20033.id.diff
Fri, Aug 8, 10:37 AM
Unknown Object (File)
Wed, Jul 23, 11:29 AM
Unknown Object (File)
Jun 23 2025, 1:46 PM
Unknown Object (File)
Jun 17 2025, 10:01 AM
Unknown Object (File)
Jun 15 2025, 6:43 AM
Unknown Object (File)
Jun 11 2025, 5:02 AM
Unknown Object (File)
Jun 9 2025, 8:36 AM
Unknown Object (File)
Jun 8 2025, 8:48 PM
Subscribers

Details

Summary

Previously, a pid check was used to prevent open of the tun(4); this works, but may not make the most sense as we don't prevent the owner process from opening the tun device multiple times.

Additionally, nothing prevents a dying tun(4) from being "reopened" in the middle of tun_destroy as soon as the mutex is unlocked, quickly leading to a bad time. Return EBUSY if we're marked for destruction, as well, and the consumer will need to deal with it. The associated character device will be destroyed in short order.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision was not accepted when it landed; it landed in state Needs Review.Apr 25 2019, 1:46 PM
This revision was automatically updated to reflect the committed changes.