Bug 29304 - mq_timedreceive does not handle 64 bit syscall return correct for !__ASSUME_TIME64_SYSCALLS
Summary: mq_timedreceive does not handle 64 bit syscall return correct for !__ASSUME_T...
Status: RESOLVED FIXED
Alias: None
Product: glibc
Classification: Unclassified
Component: libc (show other bugs)
Version: 2.32
: P2 normal
Target Milestone: 2.36
Assignee: Adhemerval Zanella
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-30 11:18 UTC by Adhemerval Zanella
Modified: 2022-06-30 13:58 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Adhemerval Zanella 2022-06-30 11:18:56 UTC
On the code path for builds without 64 bit time_t default syscall, the check to fallback to 32 bit is wrong:

 38   bool need_time64 = abs_timeout != NULL
 39                      && !in_time_t_range (abs_timeout->tv_sec);
 40   if (need_time64)
 41     {
 42       int r = SYSCALL_CANCEL (mq_timedreceive_time64, mqdes, msg_ptr, msg_len,
 43                               msg_prio, abs_timeout);
 44       if (r == 0 || errno != ENOSYS)
 45         return r;
 46       __set_errno (EOVERFLOW);
 47       return -1;
 48     }

It should check if 'r >= 0'.
Comment 1 Adhemerval Zanella 2022-06-30 13:58:17 UTC
Fixed on 2.36.