]> git.ipfire.org Git - thirdparty/glibc.git/commit
linux: Fix ancillary 64-bit time timestamp conversion (BZ #28349, BZ#28350)
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Mon, 24 Jan 2022 11:55:53 +0000 (08:55 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Fri, 28 Jan 2022 20:46:44 +0000 (17:46 -0300)
commit8fba672472ae0055387e9315fc2eddfa6775ca79
tree193cf8c7b6bd84aea38cf405a03990e0a6383923
parent38bc0f4e78934aab455b31af05cefcbf3c22bece
linux: Fix ancillary 64-bit time timestamp conversion (BZ #28349, BZ#28350)

The __convert_scm_timestamps only updates the control message last
pointer for SOL_SOCKET type, so if the message control buffer contains
multiple ancillary message types the converted timestamp one might
overwrite a valid message.

The test checks if the extra ancillary space is correctly handled
by recvmsg/recvmmsg, where if there is no extra space for the 64-bit
time_t converted message the control buffer should be marked with
MSG_TRUNC.  It also check if recvmsg/recvmmsg handle correctly multiple
ancillary data.

Checked on x86_64-linux and on i686-linux-gnu on both 5.11 and
4.15 kernel.

Co-authored-by: Fabian Vogt <fvogt@suse.de>
Reviewed-by: Florian Weimer <fweimer@redhat.com>
sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/convert_scm_timestamps.c
sysdeps/unix/sysv/linux/tst-socket-timestamp-time64.c [new file with mode: 0644]
sysdeps/unix/sysv/linux/tst-socket-timestamp.c [new file with mode: 0644]