From nobody Mon Nov 29 14:58:58 2021 X-Original-To: dev-commits-src-branches@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 876C118C4777; Mon, 29 Nov 2021 14:58:59 +0000 (UTC) (envelope-from git@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 4J2pQV45Z6z4T8b; Mon, 29 Nov 2021 14:58:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 278F62462C; Mon, 29 Nov 2021 14:58:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 1ATEww7w099183; Mon, 29 Nov 2021 14:58:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATEwwve099182; Mon, 29 Nov 2021 14:58:58 GMT (envelope-from git) Date: Mon, 29 Nov 2021 14:58:58 GMT Message-Id: <202111291458.1ATEwwve099182@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Kristof Provost Subject: git: b4a51fd9c124 - stable/12 - if_gif: fix vnet shutdown panic List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kp X-Git-Repository: src X-Git-Refname: refs/heads/stable/12 X-Git-Reftype: branch X-Git-Commit: b4a51fd9c12493e9e7ca6e2ac572ec41d99a941c Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638197939; 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=odeC/Xq9WSmf+IC2AE1HmeRQK6akJCSCOGEespCNuDk=; b=sEQLP1Fu7G93ksmfvKk+n9nVQU9bgLvCg/dDRhLzp+gdlnTBGIlgtKmu4NpswO+npE20DD oqj/pN8LwotMWHbBztGHd961IdyKR1DaoCgexS6Cs3nY3zsapMPaYXarIZ0liVGJ5oHgxi McDPmo+Ni3H83cMMC4MixR3EUp4mR7lfTPAK4NK5XCrOzZFI1Mj2/nEp+F6rSRH9CGJupI AKG0c0ZcLbUe9cTjhlAiz1a1ThqJF3mtbYgnZUyHAy673iwZQjdxR/j0mHz0emhe4/AJrP xu0SckRBAz1/oYKnHw7p6S6OUHLJ8OHXxJIyxFXT2d1xInv4OZIQbPJCwKbBvQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638197939; a=rsa-sha256; cv=none; b=MB+lpfvYcbZ28PPBMmkalnwWKZpC2Q4VS3eb4hwlNHUyvlwA/Hy+ZnnbOcuPS7nK0fgssJ Jr0RqXrVnFAKVHbzgcnh6p5P03WDz2Ygn/HjgJTnbyeUzaBopbthktLTpPMDUfU54clE7S AyEqGg5aOVIdvLZ5w3WxftcEtVgUwuZ6oRNiO/YO9Chs2IE1mQoNMJx6wiNCgmzA6mh6u6 mO9W5LdynbGutMkBqfO8DpkuzSStLjpFduOeNrt3+ey/IH1xVvmI7FRBP66tA7EDEt3Etv OXgEgUIZi1TsP8iGpC5MVmG8TGWuaZGkvyuPJ0qoSBO4OPH29G4jdaS5+uI9VA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/12 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=b4a51fd9c12493e9e7ca6e2ac572ec41d99a941c commit b4a51fd9c12493e9e7ca6e2ac572ec41d99a941c Author: Kristof Provost AuthorDate: 2021-11-04 17:05:58 +0000 Commit: Kristof Provost CommitDate: 2021-11-29 14:58:07 +0000 if_gif: fix vnet shutdown panic If an if_gif exists and has an address assigned inside a vnet when the vnet is shut down we failed to clean up the address, leading to a panic when we ip_destroy() and the V_in_ifaddrhashtbl is not empty. This happens because of the VNET_SYS(UN)INIT order, which means we destroy the if_gif interface before the addresses can be purged (and if_detach() does not remove addresses, it assumes this will be done by the stack teardown code). Set subsystem SI_SUB_PSEUDO just like if_bridge so the cleanup operations happen in the correct order. MFC after: 3 weeks Sponsored by: Rubicon Communications, LLC ("Netgate") Differential Revision: https://reviews.freebsd.org/D32835 (cherry picked from commit 8ca6c11a7cf834721c03cbe1a1aab0a17bae4d4d) --- sys/net/if_gif.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c index c9ccee4c98bd..ae70cb9e7715 100644 --- a/sys/net/if_gif.c +++ b/sys/net/if_gif.c @@ -214,7 +214,7 @@ vnet_gif_init(const void *unused __unused) in6_gif_init(); #endif } -VNET_SYSINIT(vnet_gif_init, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSINIT(vnet_gif_init, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_gif_init, NULL); static void @@ -229,7 +229,7 @@ vnet_gif_uninit(const void *unused __unused) in6_gif_uninit(); #endif } -VNET_SYSUNINIT(vnet_gif_uninit, SI_SUB_PROTO_IFATTACHDOMAIN, SI_ORDER_ANY, +VNET_SYSUNINIT(vnet_gif_uninit, SI_SUB_PSEUDO, SI_ORDER_ANY, vnet_gif_uninit, NULL); static int