Date: Mon, 29 Nov 2021 14:58:56 GMT From: Kristof Provost <kp@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org Subject: git: 60c3b9a78ae9 - stable/13 - if_gif: fix vnet shutdown panic Message-ID: <202111291458.1ATEwuUZ099075@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by kp: URL: https://cgit.FreeBSD.org/src/commit/?id=60c3b9a78ae939bf705da2f22ae36a926f28ec8b commit 60c3b9a78ae939bf705da2f22ae36a926f28ec8b Author: Kristof Provost <kp@FreeBSD.org> AuthorDate: 2021-11-04 17:05:58 +0000 Commit: Kristof Provost <kp@FreeBSD.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202111291458.1ATEwuUZ099075>