Summary: | service devfs restart leaks tap devices | ||
---|---|---|---|
Product: | Base System | Reporter: | brian |
Component: | bin | Assignee: | Kyle Evans <kevans> |
Status: | Closed Works As Intended | ||
Severity: | Affects Only Me | CC: | emaste, kevans |
Priority: | --- | ||
Version: | 10.1-RELEASE | ||
Hardware: | amd64 | ||
OS: | Any |
Description
brian
2015-02-27 21:51:02 UTC
/dev/tap device "instability" may have been due to sysctl setting: root@tokyo:/etc # ls -l /dev/tap ls: /dev/tap: No such file or directory root@tokyo:/etc # sysctl -a | grep net.link.tap.dev net.link.tap.devfs_cloning: 0 root@tokyo:/etc # sysctl -w net.link.tap.devfs_cloning=1 root@tokyo:/etc # sysctl -a | grep net.link.tap.dev net.link.tap.devfs_cloning: 1 root@tokyo:/etc # ls -l /dev/tap crw------- 1 root wheel 0xa9 Feb 28 15:30 /dev/tap It is this sysctl that's making the /dev/tap* devices spawn too frequently, though. (When set to zero, the "service devfs restart" command doesn't cause them to continue accumulating.) Also still unable to see /dev/tap with a glob, but as long as the program (qemu-devel) can load it by explicit name, it's not the end of the world for me. Hi, Taking, since I'm working on tun/tap. Is this still relevant in later FreeBSD versions? I can't seem to reproduce it (but also don't immediately see what might have fixed it), and will likely close this in two weeks as "overcome by events" unless I hear back. The frequent spawning is indeed because of devfs cloning, any lookup of /dev/tap or any /dev/tapNN that doesn't exist will cause it to get created. You can cause two or three with a simple chmod 0777 /dev/tap, even. devfs cloning in a jail can work, but it would require an unwritten MAC module to do so, IIRC. The canonical solution for this is to pre-create the tap device and unhide it in the jail. Closing this with "Works As Intended" -- the cloning behavior isn't ideal, but it is expected and non-trivial to solve. devfs cloning in a jail should not be allowed without some consideration. |