]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
MFC r323836:
authorae <ae@FreeBSD.org>
Wed, 27 Sep 2017 01:46:14 +0000 (01:46 +0000)
committerae <ae@FreeBSD.org>
Wed, 27 Sep 2017 01:46:14 +0000 (01:46 +0000)
commit63762f8bdea07336c5ec3e4e06281313d475cec9
tree680ee589db2033c035a0aac9b7289c57feccb4af
parenta9460d526b5a9cd6f6a25eaa5d98203eae1aba76
MFC r323836:
  Do not acquire IPFW_WLOCK when a named object is created and destroyed.

  Acquiring of IPFW_WLOCK is requried for cases when we are going to
  change some data that can be accessed during processing of packets flow.
  When we create new named object, there are not yet any rules, that
  references it, thus holding IPFW_UH_WLOCK is enough to safely update
  needed structures. When we destroy an object, we do this only when its
  reference counter becomes zero. And it is safe to not acquire IPFW_WLOCK,
  because noone references it. The another case is when we failed to finish
  some action and thus we are doing rollback and destroying an object, in
  this case it is still not referenced by rules and no need to acquire
  IPFW_WLOCK.

  This also fixes panic with INVARIANTS due to recursive IPFW_WLOCK acquiring.

  Sponsored by: Yandex LLC
sys/netpfil/ipfw/ip_fw_dynamic.c
sys/netpfil/ipfw/ip_fw_table.c
sys/netpfil/ipfw/nat64/nat64lsn_control.c
sys/netpfil/ipfw/nat64/nat64stl_control.c
sys/netpfil/ipfw/nptv6/nptv6.c