[Bug 271474] Possible to "lose" a tap(4) interface in a jail
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 20 Apr 2024 17:26:28 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271474 Stephen Fox <stephen.j.fox.jr@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |stephen.j.fox.jr@gmail.com --- Comment #5 from Stephen Fox <stephen.j.fox.jr@gmail.com> --- I ran into this issue as well under in a similar scenario (trying to run a bhyve VM from a jail). While trying to understand this issue, I have been doing a lot of "ls /dev" and "ls /dev/tapN"... and I realized that "ls -l /dev/tapN" creates an entry in "/dev"... ``` root@x:/etc/jail.conf.d # ifconfig tap4141 ifconfig: interface tap4141 does not exist root@x:/etc/jail.conf.d # ls -l /dev | grep tap4141 root@x:/etc/jail.conf.d # ls -l /dev/tap4141 crw------- 1 uucp dialer 0x70 Apr 20 12:53 /dev/tap4141 root@x:/etc/jail.conf.d # ifconfig tap4141 tap4141: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=80000<LINKSTATE> ether 58:9c:fc:10:97:4a groups: tap media: Ethernet 1000baseT <full-duplex> status: no carrier nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> ``` Needless to say - this is not the behavior I expected. The steps to reproduce the issue described by Joshua appear to be: ``` service jail start lose-tap-example jexec lose-tap-example ls -l /dev/tap41 service jail stop lose-tap-example ``` Here is the jail configuration file ("/etc/jail.conf.d/lose-tap-example.conf"): ``` lose-tap-example { path = "/zroot/jails/${name}"; mount.devfs; vnet; exec.start += "/bin/sh /etc/rc"; exec.stop += "/bin/sh /etc/rc.shutdown"; } ``` The host system and jail versions: ``` # freebsd-version -uk 14.0-RELEASE-p5 14.0-RELEASE-p5 # jexec lose-tap-example freebsd-version -u 14.0-RELEASE-p6 ``` And here is what it looks like from a shell for more context: ``` root@x:~ # ls -l /dev | grep tap root@x:~ # service jail start lose-tap-example Starting jails: lose-tap-example. root@x:~ # jexec lose-tap-example ifconfig lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384 options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6> inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 groups: lo nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL> root@x:~ # jexec lose-tap-example ls -l /dev/tap41 ls: /dev/tap41: No such file or directory root@x:~ # jexec lose-tap-example ifconfig lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384 options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6> inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 groups: lo nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL> tap41: flags=8802<BROADCAST,SIMPLEX,MULTICAST> metric 0 mtu 1500 options=80000<LINKSTATE> ether 52:72:e6:7e:7c:ab groups: tap media: Ethernet 1000baseT <full-duplex> status: no carrier nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> root@x:~ # service jail stop lose-tap-example Stopping jails: lose-tap-example. root@x:~ # ifconfig vtnet0: flags=1008843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST,LOWER_UP> metric 0 mtu 1500 options=80028<VLAN_MTU,JUMBO_MTU,LINKSTATE> ether (...) inet (...) netmask 0xffffff00 broadcast (...) media: Ethernet autoselect (10Gbase-T <full-duplex>) status: active nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL> lo0: flags=1008049<UP,LOOPBACK,RUNNING,MULTICAST,LOWER_UP> metric 0 mtu 16384 options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6> inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 groups: lo nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL> root@x:~ # ifconfig tap41 create ifconfig: interface tap41 already exists root@x:~ # rm /dev/tap41 root@x:~ # ifconfig tap41 create ifconfig: interface tap41 already exists ``` -- You are receiving this mail because: You are the assignee for the bug.