]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r341008:
authorae <ae@FreeBSD.org>
Fri, 7 Dec 2018 09:39:37 +0000 (09:39 +0000)
committerae <ae@FreeBSD.org>
Fri, 7 Dec 2018 09:39:37 +0000 (09:39 +0000)
commit7a2718d69b304f4e6b9db7b38932cdddcdf12a6f
treeee82661cdf1b8a57141eb808c5b3d6e0ddc450f8
parenta564bc2bd312a15e7777c8b7dec75635b3467a85
MFC r341008:
  Fix possible panic during ifnet detach in rtsock.

  The panic can happen, when some application does dump of routing table
  using sysctl interface. To prevent this, set IFF_DYING flag in
  if_detach_internal() function, when ifnet under lock is removed from
  the chain. In sysctl_rtsock() take IFNET_RLOCK_NOSLEEP() to prevent
  ifnet detach during routes enumeration. In case, if some interface was
  detached in the time before we take the lock, add the check, that ifnet
  is not DYING. This prevents access to memory that could be freed after
  ifnet is unlinked.

  Differential Revision: https://reviews.freebsd.org/D18338
sys/net/if.c
sys/net/rtsock.c