HomeFreeBSD

iflib: call ether_ifdetach and netmap_detach before stop

Description

iflib: call ether_ifdetach and netmap_detach before stop

From Jake:
Calling ether_ifdetach after iflib_stop leads to a potential race where
a stale ifp pointer can remain in the route entry list for IPv6 traffic.
This will potentially cause a page fault or other system instability if
the ifp pointer is accessed.

Move both iflib_netmap_detach and ether_ifdetach to be called prior to
iflib_stop. This avoids the race above, and helps ensure that other ifp
references are removed before stopping the interface.

Submitted by: Jacob Keller <jacob.e.keller@intel.com>
Reviewed by: erj@, gallatin@, jhb@
MFC after: 3 days
Sponsored by: Intel Corporation
Differential Revision: https://reviews.freebsd.org/D22071

Details

Provenance
erjAuthored on
Differential Revision
D22071: iflib: call ether_ifdetach and netmap_detach before stop
Parents
rS353966: frag6: add "big picture"
Branches
Unknown
Tags
Unknown