]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r368237:
authorKristof Provost <kp@FreeBSD.org>
Tue, 15 Dec 2020 15:33:28 +0000 (15:33 +0000)
committerKristof Provost <kp@FreeBSD.org>
Tue, 15 Dec 2020 15:33:28 +0000 (15:33 +0000)
commitdc5e65b9c39a09b92955832f6788c8c9d06025f0
tree1a82266a179c717d8ca2e4aaa75919f2d00d13ef
parent4d3d1b73bedfecdb2e975995572faa4433920d8e
MFC r368237:

if: Fix panic when destroying vnet and epair simultaneously

When destroying a vnet and an epair (with one end in the vnet) we often
panicked. This was the result of the destruction of the epair, which destroys
both ends simultaneously, happening while vnet_if_return() was moving the
struct ifnet to its home vnet. This can result in a freed ifnet being re-added
to the home vnet V_ifnet list. That in turn panics the next time the ifnet is
used.

Prevent this race by ensuring that vnet_if_return() cannot run at the same time
as if_detach() or epair_clone_destroy().

PR: 238870, 234985, 244703, 250870
Sponsored by: Modirum MDPay
sys/net/if.c