glibc/sysdeps/mach/hurd/bits
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
..
types linux: Add P_PIDFD 2022-05-17 10:34:36 -03:00
errno.h hurd: Define ELIBEXEC 2022-04-12 22:16:40 +02:00
fcntl.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
ioctls.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
local_lim.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
param.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
posix_opt.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
signum-arch.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
socket.h socket: Check lengths before advancing pointer in CMSG_NXTHDR 2022-08-02 11:10:25 +02:00
stat.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
statfs.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
statvfs.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
sysmacros.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
timesize.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
typesizes.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
unistd_ext.h Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00