From nobody Sat Apr 20 17:26:28 2024 X-Original-To: net@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4VMJMm3CJCz5J91N for ; Sat, 20 Apr 2024 17:26:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4VMJMm1HvFz44M7 for ; Sat, 20 Apr 2024 17:26:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1713633988; a=rsa-sha256; cv=none; b=EyjVD/9v/jYlGVyAN3igTxyV/0kOAfrV3JeQJr78EpxiTPeDc6L8sN2lyssD5SqLdGV6+D Jndc92y/bqitGSFHQLTpcuoRat2oiADPc1N1ymT+wYMLzYQAptcmRcAgCcsZgVrKEaZUK1 mGeU9qmNdqk0b44bYmf0mt86Ra9o+X2JiUGReuReSXmnAlibWfpUxrpz9rgejfavdZeREw rlExJP8WsOH0G9qJOQ3rE8i3wImNYUA3EiJG1sLHzaBAeikjN3RGqNd2CdMXWP0vDisJ7g c8KBm1ZuHyMtTj2l+9M4WjrcyvY78j/0C5Kka9zr3goEPWCE58XuuR/ke3uUcA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1713633988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=tnfrqqRr75JdqRVDrv+Aojn+Oul8OYgvW/TaRMXW/BU=; b=pmDsxVZ7yRb77nmN3itgri4F1Yvpjtggq/6G6Y6qsoICzVyy+8MzeFEpXWXBk6mFJT049H QS4WPtEj5TgoYGVo2NAQqAgBtpLrVlouIhrAS3s4tVT8cgWwAH3GoK/9DlSPjEsopREf0S 1Q+JwucSMa8X3tvDOff8zZ1BlFZIbcaWgzDzDtKisVxBpu0CgLC0+g2eS4Pa/XRqHihV9w o0V3TGr9t4Yjg2e94UERt44B8s3Owejqe1UbbIOCJOLKkfDa2WU5DdQOspbNdz+geF0RWa 8n0d5aP/65VIXluOoNCIctpdOey7WS8oVDnYB8pmn72No6BsaT0Ie9gYVdSFDw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4VMJMm0vsgzmZk for ; Sat, 20 Apr 2024 17:26:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 43KHQS04024469 for ; Sat, 20 Apr 2024 17:26:28 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 43KHQS8p024468 for net@FreeBSD.org; Sat, 20 Apr 2024 17:26:28 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: net@FreeBSD.org Subject: [Bug 271474] Possible to "lose" a tap(4) interface in a jail Date: Sat, 20 Apr 2024 17:26:28 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: misc X-Bugzilla-Version: 13.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: stephen.j.fox.jr@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Networking and TCP/IP with FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-net List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-net@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271474 Stephen Fox changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |stephen.j.fox.jr@gmail.com --- Comment #5 from Stephen Fox --- 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=3D8802 metric 0 mtu 1500 options=3D80000 ether 58:9c:fc:10:97:4a groups: tap media: Ethernet 1000baseT status: no carrier nd6 options=3D29 ``` 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.con= f"): ``` lose-tap-example { path =3D "/zroot/jails/${name}"; mount.devfs; vnet; exec.start +=3D "/bin/sh /etc/rc"; exec.stop +=3D "/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=3D1008049 metric 0 mtu 1= 6384 options=3D680003 inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 groups: lo nd6 options=3D21 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=3D1008049 metric 0 mtu 1= 6384 options=3D680003 inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3 groups: lo nd6 options=3D21 tap41: flags=3D8802 metric 0 mtu 1500 options=3D80000 ether 52:72:e6:7e:7c:ab groups: tap media: Ethernet 1000baseT status: no carrier nd6 options=3D29 root@x:~ # service jail stop lose-tap-example Stopping jails: lose-tap-example. root@x:~ # ifconfig vtnet0: flags=3D1008843 me= tric 0 mtu 1500 options=3D80028 ether (...) inet (...) netmask 0xffffff00 broadcast (...) media: Ethernet autoselect (10Gbase-T ) status: active nd6 options=3D29 lo0: flags=3D1008049 metric 0 mtu 1= 6384 options=3D680003 inet 127.0.0.1 netmask 0xff000000 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x2 groups: lo nd6 options=3D21 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 ``` --=20 You are receiving this mail because: You are the assignee for the bug.=