[PATCH v5 2/3] linux: Fix ancillary 64-bit time timestamp conversion (BZ #28349, BZ#28350)
Adhemerval Zanella Netto
adhemerval.zanella@linaro.org
Fri Sep 30 12:51:56 GMT 2022
On 30/09/22 09:31, Szabolcs Nagy wrote:
> The 09/30/2022 08:24, Adhemerval Zanella Netto wrote:
>> On 30/09/22 08:05, Szabolcs Nagy wrote:
>>> The 09/30/2022 11:47, Szabolcs Nagy via Libc-alpha wrote:
>>>> The 01/27/2022 17:15, Adhemerval Zanella via Libc-alpha wrote:
>>>>> 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>
>>>>
>>>> note: the time64 recvmsg test started to fail on 32bit
>>>> arm after i updated my aarch64 kernel to 5.18
>>>
>>> sorry the kernel is
>>> Linux 8a7948402d35 5.15.0-48-generic #54~20.04.1-Ubuntu SMP Thu Sep 1 16:20:53 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
>>
>> I just check on exactly same kernel (ubuntu 22) on a aarch64 VM and I could not
>> reproduce it:
>>
>> $ uname -a
>> Linux ubuntu-aarch64 5.15.0-48-generic #54-Ubuntu SMP Fri Aug 26 13:31:33 UTC 2022 aarch64 aarch64 aarch64 GNU/Linux
>> $ file socket/tst-socket-timestamp
>> socket/tst-socket-timestamp: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, with debug_info, not stripped
>> $ file socket/tst-socket-timestamp-time64
>> socket/tst-socket-timestamp-time64: ELF 32-bit LSB pie executable, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, with debug_info, not stripped
>> $ ./testrun.sh socket/tst-socket-timestamp
>> $ ./testrun.sh socket/tst-socket-timestamp-time64
>> $
>>
>> I used gcc 12.1.1, maybe it is a compiler issue?
>
> sorry it was my fault: old kernel headers.
Right, but I am puzzled since it should not matter (at least glibc should handle it).
What was miscompiled due wrong kernel header?
More information about the Libc-alpha
mailing list