The branch main has been updated by glebius:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f9ae08a88924ba861ad0bb76f5a9a11fb44eced8

commit f9ae08a88924ba861ad0bb76f5a9a11fb44eced8
Author:     Gleb Smirnoff <[email protected]>
AuthorDate: 2026-01-15 21:37:34 +0000
Commit:     Gleb Smirnoff <[email protected]>
CommitDate: 2026-01-15 21:37:34 +0000

    linux: on vnet detach call clean_unrhdr(9) always
    
    The assumption was incorrect, and the current VIMAGE implementation leaves
    a possibility for some interfaces still exist in a jail that is going
    away.
    
    Fixes:  607f11055d2d421770963162a4d9a99cdd136152
---
 sys/compat/linux/linux_if.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/sys/compat/linux/linux_if.c b/sys/compat/linux/linux_if.c
index f201f7c4b128..ca4e3a4079ed 100644
--- a/sys/compat/linux/linux_if.c
+++ b/sys/compat/linux/linux_if.c
@@ -105,12 +105,13 @@ static void
 linux_ifnet_vnet_uninit(void *arg __unused)
 {
        /*
-        * At a normal vnet shutdown all interfaces are gone at this point.
-        * But when we kldunload linux.ko, the vnet_deregister_sysuninit()
-        * would call this function for the default vnet.
+        * All cloned interfaces are already gone at this point, as well
+        * as interfaces that were if_vmove'd into this vnet.  However,
+        * if a jail has created IFT_ETHER interfaces in self, or has had
+        * physical Ethernet drivers attached in self, than we may have
+        * allocated entries in the unr(9), so clear it to avoid KASSERT.
         */
-       if (IS_DEFAULT_VNET(curvnet))
-               clear_unrhdr(V_linux_eth_unr);
+       clear_unrhdr(V_linux_eth_unr);
        delete_unrhdr(V_linux_eth_unr);
 }
 VNET_SYSUNINIT(linux_ifnet_vnet_uninit, SI_SUB_PROTO_IF, SI_ORDER_ANY,

Reply via email to