about summary refs log tree commit diff
path: root/sysdeps/x86/dl-cacheinfo.h
diff options
context:
space:
mode:
authorArjun Shankar <arjun@redhat.com>2022-08-02 11:10:25 +0200
committerArjun Shankar <arjun@redhat.com>2022-08-22 16:39:22 +0200
commitcbd8685e82d1b4a7160250845940be68510455ac (patch)
treebd482ebf6998be9bbea21c1b861cb8bda0224227 /sysdeps/x86/dl-cacheinfo.h
parent4bafc4001d97ad9501168e091c70f69bd50d9bd9 (diff)
downloadglibc-cbd8685e82d1b4a7160250845940be68510455ac.tar.gz
glibc-cbd8685e82d1b4a7160250845940be68510455ac.tar.xz
glibc-cbd8685e82d1b4a7160250845940be68510455ac.zip
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 9c443ac4559a47ed99859bd80d14dc4b6dd220a1)
Diffstat (limited to 'sysdeps/x86/dl-cacheinfo.h')
0 files changed, 0 insertions, 0 deletions