glibc/sysdeps
Arjun Shankar cbd8685e82 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>
(cherry picked from commit 9c443ac455)
2022-08-22 16:39:22 +02:00
..
aarch64 elf: Fix runtime linker auditing on aarch64 (BZ #26643) 2022-02-01 14:49:46 -03:00
alpha Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
arc Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
arm Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
csky Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
generic csu: Implement and use _dl_early_allocate during static startup 2022-05-17 08:08:52 +02:00
gnu Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
hppa hppa: Remove _dl_skip_args usage (BZ# 29165) 2022-06-10 08:39:05 -03:00
htl htl: Fix build error in annexc 2022-01-17 23:18:27 +00:00
hurd hurd: Fix pthread_kill on exiting/ted thread 2022-01-15 15:11:54 +01:00
i386 i386: Regenerate ulps 2022-04-27 21:17:50 -04:00
ia64 elf: Issue la_symbind for bind-now (BZ #23734) 2022-02-01 14:49:46 -03:00
ieee754 math: Fix float conversion regressions with gcc-12 [BZ #28713] 2022-01-10 14:27:17 +00:00
m68k m68k: Handle fewer relocations for RTLD_BOOTSTRAP (#BZ29071) 2022-04-20 14:54:27 -07:00
mach socket: Check lengths before advancing pointer in CMSG_NXTHDR 2022-08-22 16:39:22 +02:00
microblaze Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
mips elf: Add <dl-r_debug.h> 2022-01-31 07:05:48 -08:00
nios2 nios2: Remove _dl_skip_args usage (BZ# 29187) 2022-06-10 08:39:50 -03:00
nptl nptl: Handle spurious EINTR when thread cancellation is disabled (BZ#29029) 2022-04-15 09:44:02 -03:00
or1k or1k: Define PI_STATIC_AND_HIDDEN 2022-02-02 20:05:12 +09:00
posix socket: Use 64 bit stat for isfdtype (BZ# 29209) 2022-06-01 14:18:43 -03:00
powerpc powerpc: Fix VSX register number on __strncpy_power9 [BZ #29197] 2022-06-07 15:29:50 -03:00
pthread nptl: Fix __libc_cleanup_pop_restore asynchronous restore (BZ#29214) 2022-06-08 09:38:56 -03:00
riscv riscv: Update rv64 libm test ulps 2022-08-05 16:23:31 +02:00
s390 S390: Enable static PIE 2022-05-19 09:46:56 +02:00
sh Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
sparc Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
unix socket: Check lengths before advancing pointer in CMSG_NXTHDR 2022-08-22 16:39:22 +02:00
wordsize-32 Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
wordsize-64 Update copyright dates with scripts/update-copyrights 2022-01-01 11:40:24 -08:00
x86 x86: Add BMI1/BMI2 checks for ISA_V3 check 2022-07-18 11:46:44 -07:00
x86_64 x86: Add missing IS_IN (libc) check to strncmp-sse4_2.S 2022-07-18 11:58:12 -07:00