freebsd-dev/sys/netinet6
Hans Petter Selasky 59854ecf55 Convert all IPv4 and IPv6 multicast memberships into using a STAILQ
instead of a linear array.

The multicast memberships for the inpcb structure are protected by a
non-sleepable lock, INP_WLOCK(), which needs to be dropped when
calling the underlying possibly sleeping if_ioctl() method. When using
a linear array to keep track of multicast memberships, the computed
memory location of the multicast filter may suddenly change, due to
concurrent insertion or removal of elements in the linear array. This
in turn leads to various invalid memory access issues and kernel
panics.

To avoid this problem, put all multicast memberships on a STAILQ based
list. Then the memory location of the IPv4 and IPv6 multicast filters
become fixed during their lifetime and use after free and memory leak
issues are easier to track, for example by: vmstat -m | grep multi

All list manipulation has been factored into inline functions
including some macros, to easily allow for a future hash-list
implementation, if needed.

This patch has been tested by pho@ .

Differential Revision: https://reviews.freebsd.org/D20080
Reviewed by:	markj @
MFC after:	1 week
Sponsored by:	Mellanox Technologies
2019-06-25 11:54:41 +00:00
..
dest6.c
frag6.c Revert r346530 until further. 2019-04-22 19:36:19 +00:00
icmp6.c Fix hostname to be returned in an ICMPv6 NI Reply message defined 2019-05-16 19:09:41 +00:00
icmp6.h
in6_cksum.c
in6_fib.c
in6_fib.h
in6_gif.c Add the check that current VNET is ready and access to srchash is allowed. 2018-10-23 13:11:45 +00:00
in6_ifattach.c Convert all IPv4 and IPv6 multicast memberships into using a STAILQ 2019-06-25 11:54:41 +00:00
in6_ifattach.h
in6_jail.c
in6_mcast.c Convert all IPv4 and IPv6 multicast memberships into using a STAILQ 2019-06-25 11:54:41 +00:00
in6_pcb.c Convert all IPv4 and IPv6 multicast memberships into using a STAILQ 2019-06-25 11:54:41 +00:00
in6_pcb.h
in6_pcbgroup.c
in6_proto.c Update for IETF draft-ietf-6man-ipv6only-flag. 2019-03-06 23:31:42 +00:00
in6_rmx.c Use the new VNET_DEFINE_STATIC macro when we are defining static VNET 2018-07-24 16:35:52 +00:00
in6_rss.c
in6_rss.h
in6_src.c Restore IPV6_NEXTHOP option support that seem was partially broken 2019-05-24 11:45:32 +00:00
in6_var.h Convert all IPv4 and IPv6 multicast memberships into using a STAILQ 2019-06-25 11:54:41 +00:00
in6.c Do not perform DAD on stf(4) interfaces. 2019-03-30 18:00:44 +00:00
in6.h Convert all IPv4 and IPv6 multicast memberships into using a STAILQ 2019-06-25 11:54:41 +00:00
ip6_ecn.h
ip6_fastfwd.c New pfil(9) KPI together with newborn pfil API and control utility. 2019-01-31 23:01:03 +00:00
ip6_forward.c New pfil(9) KPI together with newborn pfil API and control utility. 2019-01-31 23:01:03 +00:00
ip6_gre.c Add GRE-in-UDP encapsulation support as defined in RFC8086. 2019-04-24 09:05:45 +00:00
ip6_id.c ip6_randomflowlabel: Avoid blocking if random(4) is not available 2019-04-23 17:18:20 +00:00
ip6_input.c New pfil(9) KPI together with newborn pfil API and control utility. 2019-01-31 23:01:03 +00:00
ip6_mroute.c Plug some networking sysctl leaks. 2018-11-22 20:49:41 +00:00
ip6_mroute.h
ip6_output.c Sort opt_foo.h #includes and add a missing blank line in ip_output(). 2019-06-11 22:07:39 +00:00
ip6_var.h Convert all IPv4 and IPv6 multicast memberships into using a STAILQ 2019-06-25 11:54:41 +00:00
ip6.h
ip6protosw.h
ip_fw_nat64.h Reapply r345274 with build fixes for 32-bit architectures. 2019-03-19 10:57:03 +00:00
ip_fw_nptv6.h Add ability to use dynamic external prefix in ipfw_nptv6 module. 2018-11-12 11:20:59 +00:00
mld6_var.h Fix refcounting leaks in IPv6 MLD code leading to loss of IPv6 2019-01-24 08:34:13 +00:00
mld6.c In mld_v2_cancel_link_timers() check number of references and disconnect 2019-05-09 07:57:33 +00:00
mld6.h
nd6_nbr.c Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
nd6_rtr.c Fix gateway setup for the interface routes. 2019-05-22 21:20:15 +00:00
nd6.c Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
nd6.h Update for IETF draft-ietf-6man-ipv6only-flag. 2019-03-07 23:03:39 +00:00
pim6_var.h
pim6.h
raw_ip6.c When an IPv6 packet is received for a raw socket which has the 2019-04-19 18:09:37 +00:00
raw_ip6.h
route6.c
scope6_var.h
scope6.c Mechanical cleanup of epoch(9) usage in network stack. 2019-01-09 01:11:19 +00:00
sctp6_usrreq.c Use a macro to set the assoc state. I missed this in r337706. 2018-08-14 08:33:47 +00:00
sctp6_var.h Whitespace changes due to changes in ident. 2018-07-19 20:16:33 +00:00
send.c Use the new VNET_DEFINE_STATIC macro when we are defining static VNET 2018-07-24 16:35:52 +00:00
send.h
tcp6_var.h
udp6_usrreq.c There are three places where we return from a function which entered an 2018-10-09 13:26:06 +00:00
udp6_var.h