On 08.03.21 18:02, Florian Bezdeka wrote:
> On systems using 32 bit for time_t the sem_timedwait syscall was broken
> because the function used for copying the timeout value from userspace
> to kernel (=sem_fetch_timeout()) was always copying
> sizeof(struct timespec64).
>
> A 32 bit application (or more specific an application with 4 byte
> time_t) would only provide sizeof(struct old_timespec32).
>
> Notable changes:
> - The copy operation from userspace to kernel is now already done in
> the syscall handler. So it is always done. Previously it was copied
> over and validated before the first use (when used at all).
> So we have some additional instructions now that may be
> unnecessary, but that simplifies the code.
>
> - Validation: Switched to timespec64_valid() instead of our own
> check.
>
> Fixes: 8043eccd232d ("cobalt/kernel: y2038: convert struct timespec to
> timespec64")
This patch was dropped from next again (and that sha was never applied).
We should go a for fixed version of that series (patches 2..5, only
patch 1 is now applied).
Jan
--
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux