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
Unknown Object (File)
Tue, Dec 17, 10:00 PM
Unknown Object (File)
Oct 10 2024, 4:19 AM
Unknown Object (File)
Sep 30 2024, 3:29 PM
Unknown Object (File)
Sep 27 2024, 10:07 AM
Unknown Object (File)
Sep 25 2024, 8:47 AM
Unknown Object (File)
Sep 24 2024, 3:24 AM
Unknown Object (File)
Sep 18 2024, 9:27 PM
Unknown Object (File)
Sep 8 2024, 7:36 AM
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.