From nobody Mon Nov 29 14:58:56 2021 X-Original-To: dev-commits-src-all@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 4DCD218C4980; Mon, 29 Nov 2021 14:58:57 +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 4J2pQT0HwZz4T8V; Mon, 29 Nov 2021 14:58:57 +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 DF820244DC; Mon, 29 Nov 2021 14:58:56 +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 1ATEwuiV099076; Mon, 29 Nov 2021 14:58:56 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 1ATEwuUZ099075; Mon, 29 Nov 2021 14:58:56 GMT (envelope-from git) Date: Mon, 29 Nov 2021 14:58:56 GMT Message-Id: <202111291458.1ATEwuUZ099075@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: 60c3b9a78ae9 - stable/13 - if_gif: fix vnet shutdown panic List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@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/13 X-Git-Reftype: branch X-Git-Commit: 60c3b9a78ae939bf705da2f22ae36a926f28ec8b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1638197937; 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=y6nvvBGo+gAm5glI+n/VouR1BObT+aTZZ84uz6JydzQ=; b=vJ6Pfa7P67J2KXIDBD5+3Cu4j+swZga2g7fQQEqoD3U2GUJzLJjT07JtmdgF/BkEHEYUwA 9UFaFL5wTKK+zExQWJ1UNSTtjwXqBX/zSdyYB1wcvH43UGP62BJPGF/zHSZNQtxI8CNlC/ ZVQU/BkBUTqN6cAX5eA+5GEeoF/emBfbJUisOb+DBnBCPvepPX/u2kRGdGmR+1l2q/s+v0 /gTh3ORRCDeIoDuHYvx4Vk7sGuS3a7YUfv5EDKlwYKP0cAjCjr6GMqXltO4WJfA1znFB5D t8nmKywD0nKm1YRNYdHvGQqfSB9KXaqHkgGjYb3QN8M/Jf7GL6zC48iv7vBoPA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1638197937; a=rsa-sha256; cv=none; b=LaAS54YlVbAgXbFVxXHfTUeGX6LTZGJo+y214f7j7oVFrsWG/mUoPX6gRDLeStzvFgTpM6 5F7sY2FsEWxNGP3u7HekDiXhTLCwf4Pxz46dmQEZIBlrog2AiB1z2q1SzysUDE1Jod/2gK 0wYkHf2Z0lO/Ssz/zgryWM8gK1cQ/XieO7oaDWhMswaIbEwoeVMYbxjsD+2wUbgCO9dL4f YIBcU+4aE3idDAMP5GWLrRV0NjQl6ZygPc5bqXxj7LK7SQBlHPG3qoWCrTVLkXCXVSL5Kg Mlfaz88Fn1pyNjsEjhml7pfLkuMXXXroSbzS6CpUKgqlHckvotnET7Nx1axNgw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=60c3b9a78ae939bf705da2f22ae36a926f28ec8b commit 60c3b9a78ae939bf705da2f22ae36a926f28ec8b Author: Kristof Provost AuthorDate: 2021-11-04 17:05:58 +0000 Commit: Kristof Provost CommitDate: 2021-11-29 14:44:39 +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 796f427e356b..ea4b80690e50 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