glibc/sysdeps/mach
Arjun Shankar 9c443ac455 socket: Check lengths before advancing pointer in CMSG_NXTHDR
The inline and library functions that the CMSG_NXTHDR macro may expand
to increment the pointer to the header before checking the stride of
the increment against available space.  Since C only allows incrementing
pointers to one past the end of an array, the increment must be done
after a length check.  This commit fixes that and includes a regression
test for CMSG_FIRSTHDR and CMSG_NXTHDR.

The Linux, Hurd, and generic headers are all changed.

Tested on Linux on armv7hl, i686, x86_64, aarch64, ppc64le, and s390x.

[BZ #28846]

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
2022-08-02 11:10:25 +02:00
..
htl htl: Fix cleaning the reply port 2022-01-22 02:17:19 +01:00
hurd socket: Check lengths before advancing pointer in CMSG_NXTHDR 2022-08-02 11:10:25 +02:00
i386 Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
include hurd: break relocation loop between libc.so and lib{mach,hurd}user.so 2020-11-14 00:52:52 +01:00
sys Installed-header hygiene (BZ#20366): obsolete BSD u_* types. 2016-09-23 08:43:56 -04:00
_strerror.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
adjtime.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
clock_gettime.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
clock_nanosleep.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
configure configure: Replaced obsolete AC_TRY_COMPILE 2021-06-04 10:16:00 -03:00
configure.ac configure: Replaced obsolete AC_TRY_COMPILE 2021-06-04 10:16:00 -03:00
getloadavg.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
getpagesize.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
getsysstats.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
libc-lock.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
libmachuser.abilist hurd: add base abilist files 2018-01-28 17:26:35 +01:00
Makefile Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
mprotect.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
msync.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
munmap.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
pagecopy.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
readonly-area.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
sched_yield.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
sleep.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
strerror_l.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
Subdirs * Makefile (subdir-target-args): New variable. 2006-02-28 07:11:04 +00:00
sysdep.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
thread_state.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
usleep.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
xpg-strerror.c Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00