HomeFreeBSD

vlan: Fix panic when vnet jail with a vlan interface is destroyed

Description

vlan: Fix panic when vnet jail with a vlan interface is destroyed

During vnet cleanup vnet_if_uninit() checks that no more interfaces remain in
the vnet. Any interface borrowed from another vnet is returned by
vnet_if_return(). Other interfaces (i.e. cloned interfaces) should have been
destroyed by their cloner at this point.

The if_vlan VNET_SYSUNINIT had priority SI_ORDER_FIRST, which means it had
equal priority as vnet_if_uninit(). In other words: it was possible for it to
be called *after* vnet_if_uninit(), which would lead to assertion failures.

Set the priority to SI_ORDER_ANY, like other cloners to ensure that vlan
interfaces are destroyed before we enter vnet_if_uninit().

The sys/net/if_vlan test provoked this.

Details

Provenance
kpAuthored on
Parents
rS357355: Add two missing fences with comments describing them. These were found by
Branches
Unknown
Tags
Unknown