From nobody Wed May 17 21:54:07 2023 X-Original-To: bugs@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 4QM6M36yPbz4BdYN for ; Wed, 17 May 2023 21:54:07 +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 4QM6M34mgQz3FZw for ; Wed, 17 May 2023 21:54:07 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1684360447; 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; bh=vVw/N4zA+RzbbkUsEnxgj//sPFwxu3pFIK61Po0Lzog=; b=JS4XdWV0v//4mafcg54vwllEK1xZ6pyF2UtZYOLOg5iml1a4hzdpThSCVilWH5TBIW/UIi 614HNCAJKzU8AwmzBWf0Jdsguludrn9BELggIk/Zih+pgGA3xWBEWFVVgvZdHXFftydy9p Dkl+y9od29oUtDGYlhUNvApzMgWoP8GbiKlHU4n6Lvbi9Z+aXPiikbMSJCtFwrmarKVAPe TGwI4A9wdI4yfamrLROLSSy4GSsJd4W4jqBoxsCQwGcORqMQNcP0sy+zADhBa00vYv9nbi vLi0jQbWBDvmuEmyj8I5oxBfHAMJc+3QJUHeyrfMS+ZcWjFj+7En38zSm0WPeg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1684360447; a=rsa-sha256; cv=none; b=Qu0QyxpUPCieofXNDoPh8N2NiNGQtmnOfsdmWz29LbEdmY1lFwtAnHiBpupOjfHnxNVep+ 47c7rvi8udJ97qKoIKN5L/GYmbnV2KNHLF12CVqDvTXrDEKRTEjbR3WjPLUpWMLBpzW8O1 lTWE/SUW54nESaga4o4I+sC5kaU+Yc3v0kgGYswfBfnbf041dvgLGecg5oltoYvnDQ7Azo YqEHKoFtMc7LDQ/nUcD2/6eyS/X3/NHcgjAwz3p1hMQDJWiG3Ahzq8+Je10yMUP4ocZMmi CssucqxpSJVqbleRnA6sqW3tESzgYGFgj23zAsYvqqO2psXMIUW8ZmpJaL5+zw== 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 4QM6M33qRfzKhH for ; Wed, 17 May 2023 21:54:07 +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 34HLs7pt013244 for ; Wed, 17 May 2023 21:54:07 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 34HLs7sH013243 for bugs@FreeBSD.org; Wed, 17 May 2023 21:54:07 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: bugs@FreeBSD.org Subject: [Bug 271474] Possible to "lose" a tap(4) interface in a jail Date: Wed, 17 May 2023 21:54:07 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new 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: freebsd@kumba.dev X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: 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: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@freebsd.org MIME-Version: 1.0 X-ThisMailContainsUnwantedMimeParts: N https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D271474 Bug ID: 271474 Summary: Possible to "lose" a tap(4) interface in a jail Product: Base System Version: 13.2-RELEASE Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: misc Assignee: bugs@FreeBSD.org Reporter: freebsd@kumba.dev So after some trial and error, I have discovered that it is possible to literally "lose" a tap(4) interface inside of a jail during shutdown if the conditions are right. I am trying to run bhyve within a VNET jail, and tho= ught I would be OK to create 'tap0' inside the jail itself via /etc/rc.conf rath= er than at the host level and passing it in via VNET. This kinda works for the most part, but in the process of trying to work out how to get bhyve to run inside of a jail, I had to start/stop the jail seve= ral times. In one of those instances, I forgot to run "bhyvectl --vm=3Dfoo --destroy" before I ran "jail -r foojail". The jail shutdown like it shoul= d, then when I went to run "jail -c foojail", I noticed in the console output = that it was unable to create the 'tap0' interface because it already existed. Dropping into the jail, 'ifconfig' showed no visible 'tap0' interface. Sam= e at the host level. Somewhere in kernel memory, though, there was a 'tap0' interface with no way to get at it. Doing a proper shutdown of the bhyve instance did not release it, nor did restarting the jail. Only a full syst= em reboot got things back to normal. That's the problem description, anyways. As for a fix, I honestly don't ha= ve a good suggestion. Starting and stopping of jails is really just being clever with shell scripting in /etc/jail.conf, so it would be really hard to handl= e a case where jail shutdown can catch a failure to stop an interface and return that back to 'jail' and have it abort the shutdown. For me, I decided to p= lay it safe and moved the creation of the tap(4) interface to the host level and then just pass it to the jail as a vnet.interface parameter. --=20 You are receiving this mail because: You are the assignee for the bug.=