acadia-newlib/newlib/libc
hselasky d41e144869 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-09-25 09:01:15 +02:00
..
argz ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
ctype update to Unicode 11.0 2019-01-13 23:33:51 +01:00
errno makedoc: make errors visible 2017-12-07 11:54:11 +00:00
iconv ansification: remove _EXFUN, _EXFUN_NOTHROW 2018-01-17 11:47:29 -06:00
include libc/include/devctl.h: Add SOCKCLOSE per FACE Technical Standard, Edition 3.0 2019-09-10 10:49:11 -05:00
locale newlib: Drop incorrect const qualifier from __loadlocale parameter 2018-10-10 11:18:20 +02:00
machine riscv/include/fenv.h: Use shared fenv.h. 2019-09-03 09:52:34 -05:00
misc RISC-V: Do not use _init/_fini 2018-07-30 10:47:57 +02:00
posix scandir: Add support for struct dirent::d_type 2019-02-01 10:37:00 +01:00
reent ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
search Miscellaneous Makefile.in regenerated 2019-08-09 17:49:16 +02:00
signal Fix newlib functions perror()/psignal() not to use writev(). 2018-07-05 15:33:49 -04:00
ssp AMD GCN Port contributed by Andrew Stubbs <ams@codesourcery.com> 2019-01-15 10:48:08 -05:00
stdio Fix vfwscanf(3) assignment suppression flag handling bug 2019-06-03 10:38:40 +02:00
stdio64 ansification: remove _EXFNPTR, _EXPARM 2018-01-17 11:47:27 -06:00
stdlib fix compile errors for efgcvt.c 2019-07-24 11:58:21 +02:00
string memmem.c and strstr.c: do not require -std=c99 2019-08-14 10:39:37 +02:00
sys Convert all IPv4 and IPv6 multicast memberships 2019-09-25 09:01:15 +02:00
syscalls ansification: remove _HAVE_STDC 2018-01-17 11:47:30 -06:00
time newlib: strftime: fix over-enthusiastic fix from 0283642f35 2018-08-08 23:59:34 +02:00
unix Fix comparison between two character arrays 2018-07-30 09:36:49 +02:00
xdr xdr_private.h needs sys/types.h for u_char 2018-09-06 14:10:42 +02:00
Makefile.am ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
Makefile.in ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
aclocal.m4 Fix up errors in regenerated files for 2.3.0 release. 2016-01-04 12:57:31 -05:00
configure Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
configure.in ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
libc.in.xml ssp: add documentation 2017-11-29 11:25:45 -06:00
libc.texinfo ssp: add documentation 2017-11-29 11:25:45 -06:00
saber Remove matherr, and SVID and X/Open math library configurations 2019-01-23 10:46:24 +01:00
sys.tex Don't include stdio64 functions in reentrant syscalls menu when not bulding stdio64. 2015-08-03 09:54:33 +01:00