]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r312544
authorrstone <rstone@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 7 Feb 2017 15:12:27 +0000 (15:12 +0000)
committerrstone <rstone@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Tue, 7 Feb 2017 15:12:27 +0000 (15:12 +0000)
commit789d7daa6b1588c619b99ee429b6bef6e09a938c
tree13f05c0d9a7a63b19ac9865fbc54c8d13dbadb15
parentf3dcf354cd89bce92f66d683533575720bc0360b
MFC r312544

  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

git-svn-id: svn://svn.freebsd.org/base/stable/10@313387 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/dev/ixgbe/if_ix.c
sys/net/if_media.c