Page MenuHomeFreeBSD

lagg, edsc: Detach the cloners at SI_SUB_PSEUDO on vnet teardown
Needs ReviewPublic

Authored by olivier on Sat, Oct 10, 2:32 PM.
Tags
None
Referenced Files
F175795830: D60584.diff
Tue, Oct 13, 10:28 AM
F175706703: D60584.diff
Mon, Oct 12, 4:14 PM
F175696466: D60584.id189359.diff
Mon, Oct 12, 2:37 PM
Unknown Object (File)
Sun, Oct 11, 11:10 PM
Unknown Object (File)
Sun, Oct 11, 7:59 PM
Unknown Object (File)
Sun, Oct 11, 4:31 PM
Unknown Object (File)
Sun, Oct 11, 3:09 PM
Unknown Object (File)
Sun, Oct 11, 1:58 PM
Subscribers
None

Details

Reviewers
markj
Summary

At SI_SUB_INIT_IF, vnet_lagg_uninit() and vnet_edsc_uninit() tie with linux_ifnet_vnet_uninit().
Ties run in reverse registration order, so with if_lagg or if_edsc loaded before linux_common, the linux unit allocator is deleted first.
Destroying a vnet jail with a live lagg or edsc interface then panics in free_unr() from linux_ifnet_departure().

Move both uninits to SI_SUB_PSEUDO, as done for epair in 5c20c75b67e3.
This completes a23901a37be9, which left them tied with linux.

Test Plan

How to reproduce the panic before this patch applied:

sh
kldload if_epair if_lagg if_edsc
kldload linux_common          # load after the drivers
a=$(ifconfig epair create); b=${a%a}b
jail -c name=j persist vnet vnet.interface=$b
jexec j ifconfig lagg0 create laggproto lacp laggport $b up
jail -r j                     # panic

jail -c name=k persist vnet
jexec k ifconfig edsc0 create up
jail -r k                     # panic

Diff Detail

Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

olivier created this revision.