CVSROOT: /cvs
Module name: src
Changes by: [email protected] 2024/11/05 03:49:23
Modified files:
sys/kern : kern_sysctl.c
sys/netinet : in_pcb.c in_pcb.h udp_usrreq.c
sys/netinet6 : in6_pcb.c
Log message:
Replace rwlock with iterator in UDP input multicast loop.
The broadcast and multicast loop in udp_input() is protected by the
table mutex. The relevant PCBs were collected in a separate list,
which was processed while the table notify rwlock was held. When
sending UDP multicast packets over vxlan(4) configured over UDP
with multicast groups, this lock was taken recursively causing a
kernel crash.
By using an iterator, traversing the PCB list of the table does not
require to hold the mutex all the time. Only while accessing the
next element after the iterator, the mutex is taken for a short
time. udp_sbappend() and the upcall to vxlan_input() is done with
neither mutex nor rwlock. The PCB is reference counted while
traversing the list.
crash reported by Holger Glaess; iterator implemented by mvs@;
tested and fixed by bluhm@; OK mvs@