Bug 208171 - dummynet: MFC r292254 to prevent kldunload panics
Summary: dummynet: MFC r292254 to prevent kldunload panics
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 10.2-STABLE
Hardware: Any Any
: --- Affects Only Me
Assignee: Hans Petter Selasky
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-21 06:38 UTC by Franco Fichtner
Modified: 2016-03-24 09:25 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Franco Fichtner 2016-03-21 06:38:30 UTC
Patch and further info can be found here: https://reviews.freebsd.org/D3855
See also: https://svnweb.freebsd.org/base?view=revision&revision=292254

MFC was set to 1 week in mid Dec 2015. Patch applies, compiles and successfully prevents kldunload panics for dummynet (as tested on 10.2-RELEASE).
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2016-03-22 02:29:15 UTC
Over to committer of r292254.
Comment 2 commit-hook freebsd_committer 2016-03-24 09:23:59 UTC
A commit references this bug:

Author: hselasky
Date: Thu Mar 24 09:22:59 UTC 2016
New revision: 297228
URL: https://svnweb.freebsd.org/changeset/base/297228

Log:
  MFC r292254:

  Properly drain callouts in the IPFW subsystem to avoid use after free
  panics when unloading the dummynet and IPFW modules:

  - The callout drain function can sleep and should not be called having
  a non-sleepable lock locked. Remove locks around "ipfw_dyn_uninit(0)".

  - Add a new "dn_gone" variable to prevent asynchronous restart of
  dummynet callouts when unloading the dummynet kernel module.

  - Call "dn_reschedule()" locked so that "dn_gone" can be set and
  checked atomically with regard to starting a new callout.

  PR:			208171
  Requested by:		Franco Fichtner (opnsense.org)
  Differential Revision:	https://reviews.freebsd.org/D3855

Changes:
_U  stable/10/
  stable/10/sys/netpfil/ipfw/ip_dn_io.c
  stable/10/sys/netpfil/ipfw/ip_dummynet.c
  stable/10/sys/netpfil/ipfw/ip_fw2.c