about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/convert_scm_timestamps.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright dates with scripts/update-copyrightsPaul Eggert2024-01-011-1/+1
|
* linux: Fix i686 with gcc6Adhemerval Zanella Netto2023-07-261-0/+9
| | | | | | | | | | | | On __convert_scm_timestamps GCC 6 issues an warning that tvts[0]/tvts[1] maybe be used uninitialized, however it would be used if type is set to a value different than 0 (done by either COMPAT_SO_TIMESTAMP_OLD or COMPAT_SO_TIMESTAMPNS_OLD) which will fallthrough to 'common' label. It does not show with gcc 7 or more recent versions. Checked on i686-linux-gnu. Reviewed-by: Carlos O'Donell <carlos@redhat.com>
* Update copyright dates with scripts/update-copyrightsJoseph Myers2023-01-061-1/+1
|
* linux: Fix missing __convert_scm_timestamps (BZ #28860)Adhemerval Zanella2022-02-031-2/+2
| | | | | | | | | Commit 948ce73b31 made recvmsg/recvmmsg to always call __convert_scm_timestamps for 64 bit time_t symbol, so adjust it to always build it for __TIMESIZE != 64. It fixes build for architecture with 32 bit time_t support when configured with minimum kernel of 5.1.
* linux: Fix ancillary 64-bit time timestamp conversion (BZ #28349, BZ#28350)Adhemerval Zanella2022-01-281-6/+8
| | | | | | | | | | | | | | | | | | | | 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>
* Revert "linux: Fix ancillary 64-bit time timestamp conversion (BZ #28349, BZ ↵Adhemerval Zanella2022-01-121-6/+5
| | | | | | #28350)" This reverts commit 21e0f45c7d73df6fe30c77ffcc9f81410e2ee369.
* linux: Fix ancillary 64-bit time timestamp conversion (BZ #28349, BZ #28350)Adhemerval Zanella2022-01-121-5/+6
| | | | | | | | | | | | | | | | | | 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 check 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>
* Update copyright dates with scripts/update-copyrightsPaul Eggert2022-01-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | I used these shell commands: ../glibc/scripts/update-copyrights $PWD/../gnulib/build-aux/update-copyright (cd ../glibc && git commit -am"[this commit message]") and then ignored the output, which consisted lines saying "FOO: warning: copyright statement not found" for each of 7061 files FOO. I then removed trailing white space from math/tgmath.h, support/tst-support-open-dev-null-range.c, and sysdeps/x86_64/multiarch/strlen-vec.S, to work around the following obscure pre-commit check failure diagnostics from Savannah. I don't know why I run into these diagnostics whereas others evidently do not. remote: *** 912-#endif remote: *** 913: remote: *** 914- remote: *** error: lines with trailing whitespace found ... remote: *** error: sysdeps/unix/sysv/linux/statx_cp.c: trailing lines
* linux: Use the expected size for SO_TIMESTAMP{NS} convertionAdhemerval Zanella2021-07-061-2/+5
| | | | | | | Kernel returns 32-bit values for COMPAT_SO_TIMESTAMP{NS}_OLD, not 64-bit values. Checked on x86_64-linux-gnu and i686-linux-gnu.
* linux: Check for null value msghdr struct before useKhem Raj2021-07-051-0/+2
| | | | | | | | This avoids crashes in libc when cmsg is null and refrencing msg structure when it is null Signed-off-by: Khem Raj <raj.khem@gmail.com> Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
* linux: Add fallback for 64-bit time_t SO_TIMESTAMP{NS}Adhemerval Zanella2021-06-151-0/+95
The recvmsg handling is more complicated because it requires check the returned kernel control message and make some convertions. For !__ASSUME_TIME64_SYSCALLS it converts the first 32-bit time SO_TIMESTAMP or SO_TIMESTAMPNS and appends it to the control buffer if has extra space or returns MSG_CTRUNC otherwise. The 32-bit time field is kept as-is. Calls with __TIMESIZE=32 will see the converted 64-bit time control messages as spurious control message of unknown type. Calls with __TIMESIZE=64 running on pre-time64 kernels will see the original message as a spurious control ones of unknown typ while running on kernel with native 64-bit time support will only see the time64 version of the control message. Checked on x86_64-linux-gnu and i686-linux-gnu (on 5.4 and on 4.15 kernel). Reviewed-by: Carlos O'Donell <carlos@redhat.com> Tested-by: Carlos O'Donell <carlos@redhat.com>