freebsd-nq/sys/dev/ixgbe
Ryan Stone 7d309e8e40 Fix reference to free memory in ixgbe/if_media.c
When ixgbe receives an interrupt indicating that a new optical module
may have been inserted, it discards all of its current media types
by calling ifmedia_removeall() and then creates a new set of media
types for the supported media on the new module.  However,
ifmedia_removeall() was maintaining a pointer to whatever the
current media type was before the call to ifmedia_removealL().
The result of this was that any attempt to read the current media
type of the interface (e.g. via ifconfig) would return potentially
garbage data from free memory (or if one were particularly unlucky
on an architecture that does not malloc() from a direct map, page
fault the kernel).

Fix this by NULL'ing out the current media field in if_media.c,
and have ixgbe update the current media type after recreating
them.

Submitted by:	Matt Joras <matt.joras AT gmail DOT com>
Reviewed by:	sbruno, erj
MFC after:	1 week
Sponsored by:	Dell EMC Isilon
Differential Revision:	https://reviews.freebsd.org/D9164
2017-01-20 17:16:48 +00:00
..
if_ix.c Fix reference to free memory in ixgbe/if_media.c 2017-01-20 17:16:48 +00:00
if_ixv.c Do not initialize the adapter on MTU change when adapter status is down. 2016-07-07 03:39:18 +00:00
ix_txrx.c net: Use M_HASHTYPE_OPAQUE_HASH if the mbuf flowid has hash properties 2016-06-07 04:51:50 +00:00
ixgbe_82598.c
ixgbe_82598.h
ixgbe_82599.c
ixgbe_82599.h
ixgbe_api.c dev/e1000,ixgbe: minor spelling fixes. 2016-05-06 22:54:56 +00:00
ixgbe_api.h
ixgbe_common.c dev/e1000,ixgbe: minor spelling fixes. 2016-05-06 22:54:56 +00:00
ixgbe_common.h
ixgbe_dcb_82598.c
ixgbe_dcb_82598.h
ixgbe_dcb_82599.c
ixgbe_dcb_82599.h
ixgbe_dcb.c
ixgbe_dcb.h
ixgbe_mbx.c dev/e1000,ixgbe: minor spelling fixes. 2016-05-06 22:54:56 +00:00
ixgbe_mbx.h
ixgbe_osdep.c
ixgbe_osdep.h
ixgbe_phy.c Fixup DA cable detection routines to not set the cable type to 2016-07-19 17:31:48 +00:00
ixgbe_phy.h
ixgbe_type.h dev/e1000,ixgbe: minor spelling fixes. 2016-05-06 22:54:56 +00:00
ixgbe_vf.c
ixgbe_vf.h
ixgbe_x540.c
ixgbe_x540.h
ixgbe_x550.c
ixgbe_x550.h
ixgbe.h Consistently use device_t 2016-08-09 19:32:06 +00:00