Kristof Provost 703e533da5 mbuf: do not restore dying interfaces
When we remove an interface it is first removed from the interface list
V_ifnet (by if_unlink_ifnet()) and marked as IFF_DYING. We then wait for
any possible references to stop being used (i.e.
epoch_wait/epoch_drain_callbacks) before we tear it fully down.

However, the index in ifindex_table is not removed, so m_rcvif_restore()
can still find the (now dying) interface.

This results in panics, for example when dummynet restores the rcvif
pointer and passes a packet to ip6_input() we can panic because the
AF_INET6 domain has already been removed (so we end up dereferencing a
NULL pointer there).

Check that the interface is not dying before we restore it, which is
equivalent to checking its presence in V_ifnet, and thus ensures that
future accesses (while in NET_EPOCH) are safe.

Reviewed by:	glebius
Sponsored by:	Rubicon Communications, LLC ("Netgate")
Differential Revision:	https://reviews.freebsd.org/D34076
2022-01-28 23:09:08 +01:00
..
2022-01-27 11:40:34 +00:00
2022-01-27 11:40:34 +00:00
2021-06-07 16:45:50 -04:00
2020-11-19 02:50:48 +00:00
2022-01-26 13:40:27 -06:00
2021-11-29 22:04:43 +00:00
2021-12-28 13:51:25 -08:00
2020-12-04 18:56:44 +00:00
2021-09-09 10:11:02 -04:00
2021-04-18 11:19:15 -06:00
2021-11-10 21:18:54 +02:00
2020-11-05 15:08:56 +00:00
2021-09-14 14:29:27 -04:00
2021-08-08 21:54:49 -04:00
2021-12-14 14:52:25 +00:00
2020-11-09 00:34:23 +00:00
2021-09-03 23:13:42 -04:00
2020-08-13 20:48:14 +00:00
2021-04-02 15:41:51 +03:00
2020-01-12 23:52:16 +00:00
2022-01-27 11:40:34 +00:00
2021-12-09 02:49:10 +02:00
2021-12-09 02:49:10 +02:00
2021-04-18 11:14:17 -06:00
2020-08-27 05:11:15 +00:00
2021-09-03 22:18:51 -04:00
2021-11-17 20:12:26 +00:00
2022-01-08 05:41:44 +02:00