Page MenuHomeFreeBSD

if: Fix panic when destroying vnet and epair simultaneously
ClosedPublic

Authored by kp on Nov 26 2020, 12:04 AM.
Tags
None
Referenced Files
Unknown Object (File)
Jun 18 2025, 4:08 PM
Unknown Object (File)
Jun 11 2025, 4:21 PM
Unknown Object (File)
Jun 10 2025, 7:25 PM
Unknown Object (File)
May 22 2025, 3:52 AM
Unknown Object (File)
May 18 2025, 1:56 PM
Unknown Object (File)
May 6 2025, 5:34 AM
Unknown Object (File)
Apr 16 2025, 9:20 AM
Unknown Object (File)
Mar 25 2025, 7:55 PM
Subscribers

Details

Summary

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, 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
MFC after: 2 weeks
Sponsored by: Modirum MDPay

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 35047
Build 32024: arc lint + arc unit

Event Timeline

kp requested review of this revision.Nov 26 2020, 12:04 AM
This revision was not accepted when it landed; it landed in state Needs Review.Dec 1 2020, 4:24 PM
This revision was automatically updated to reflect the committed changes.