]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
dummynet: Fix schedlist and aqmlist locking
authorKristof Provost <kp@FreeBSD.org>
Fri, 21 May 2021 12:26:49 +0000 (14:26 +0200)
committerKristof Provost <kp@FreeBSD.org>
Thu, 3 Jun 2021 07:02:49 +0000 (09:02 +0200)
commit51d73df18e4d120f6f062062c18efae3ed5193a6
tree8f7973e9c6c3f5f17537f08867da69f94189c5a2
parentfe3bcfbda30e763a3ec56083b3a19cebbeaf8952
dummynet: Fix schedlist and aqmlist locking

These are global (i.e. shared across vnets) structures, so we need
global lock to protect them.  However, we look up entries in these lists
(find_aqm_type(), find_sched_type()) and return them. We must ensure
that the returned structures cannot go away while we are using them.

Resolve this by using NET_EPOCH(). The structures can be safely accessed
under it, and we postpone their cleanup until we're sure they're no
longer used.

MFC after: 2 weeks
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D30381
sys/netpfil/ipfw/dn_aqm.h
sys/netpfil/ipfw/dn_sched.h
sys/netpfil/ipfw/ip_dn_glue.c
sys/netpfil/ipfw/ip_dummynet.c