]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit - sys/net/if.c
net: mitigate vnet / epair cleanup races
authorKristof Provost <kp@FreeBSD.org>
Tue, 8 Sep 2020 14:54:10 +0000 (14:54 +0000)
committerKristof Provost <kp@FreeBSD.org>
Tue, 8 Sep 2020 14:54:10 +0000 (14:54 +0000)
commita969635b837a4bb0cc554eadaf0475e231878c05
tree782bf75d21917ba8ab3bfd431a668c353d334504
parentbc42dacb0ecbac69ed66d329f756f9b7862aad79
net: mitigate vnet / epair cleanup races

There's a race where dying vnets move their interfaces back to their original
vnet, and if_epair cleanup (where deleting one interface also deletes the other
end of the epair). This is commonly triggered by the pf tests, but also by
cleanup of vnet jails.

As we've not yet been able to fix the root cause of the issue work around the
panic by not dereferencing a NULL softc in epair_qflush() and by not
re-attaching DYING interfaces.

This isn't a full fix, but makes a very common panic far less likely.

PR: 244703, 238870
Reviewed by: lutz_donnerhacke.de
MFC after: 4 days
Differential Revision: https://reviews.freebsd.org/D26324
sys/net/if.c
sys/net/if_epair.c