diff options
author | Arjun Shankar <arjun@redhat.com> | 2022-08-02 11:10:25 +0200 |
---|---|---|
committer | Arjun Shankar <arjun@redhat.com> | 2022-08-02 11:10:25 +0200 |
commit | 9c443ac4559a47ed99859bd80d14dc4b6dd220a1 (patch) | |
tree | c7965d741b7efbbb8e86e5063f7a097b8b9bf8e2 /socket/Makefile | |
parent | 521d54056242aae41ad362bd95ab17c50138337a (diff) | |
download | glibc-9c443ac4559a47ed99859bd80d14dc4b6dd220a1.zip glibc-9c443ac4559a47ed99859bd80d14dc4b6dd220a1.tar.gz glibc-9c443ac4559a47ed99859bd80d14dc4b6dd220a1.tar.bz2 |
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>
Diffstat (limited to 'socket/Makefile')
-rw-r--r-- | socket/Makefile | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/socket/Makefile b/socket/Makefile index 156eec6..2bde783 100644 --- a/socket/Makefile +++ b/socket/Makefile @@ -34,6 +34,7 @@ routines := accept bind connect getpeername getsockname getsockopt \ tests := \ tst-accept4 \ tst-sockopt \ + tst-cmsghdr \ # tests tests-internal := \ |