y2038: lib/cobalt: Fix __STD() macro usage for some services
PATCH 1/1 y2038: lib/cobalt: Fix __STD() macro usage for some services
The macro usage was broken for the following services:
- recvmmsg
- mq_timedsend
- mq_timedreceive
The message queue services were forwarded to wrong libc functions, the recvmmsg was missing the correct routing.
Detected while trying to remove the function wrapping at all.
--- include/cobalt/mqueue.h | 4 ++-- include/cobalt/sys/socket.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)
include/cobalt/mqueue.h +2 -2
@@ -42,14 +42,14 @@ COBALT_DECL(int, mq_setattr,COBALT_DECL (int, mq_send, (mqd_t qd, const char *buffer, size_t len, unsigned prio)); -COBALT_DECL_TIME64 (int, mq_timedsend, __mq_timedsend64, +COBALT_DECL_TIME64 (int, mq_timedsend, __mq_timedsend_time64, (mqd_t q, const char *buffer, size_t len, unsigned prio, const struct timespec *timeout));COBALT_DECL (ssize_t, mq_receive, (mqd_t q, char *buffer, size_t len, unsigned *prio)); -COBALT_DECL_TIME64 (ssize_t, mq_timedreceive, __mq_timedsend_time64, +COBALT_DECL_TIME64 (ssize_t, mq_timedreceive, __mq_timedreceive_time64, (mqd_t q, char *__restrict__ buffer, size_t len, unsigned *__restrict__ prio, const struct timespec *__restrict__ timeout));
include/cobalt/sys/socket.h +3 -3
@@ -31,9 +31,9 @@ COBALT_DECL(int, socket, (int protocol_family, int socket_type, int protocol)); COBALT_DECL(ssize_t, recvmsg, (int fd, struct msghdr *msg, int flags)); -COBALT_DECL (int, recvmmsg, - (int fd, struct mmsghdr *msgvec, unsigned int vlen, - unsigned int flags, struct timespec *timeout)); +COBALT_DECL_TIME64 (int, recvmmsg, __recvmmsg64, + (int fd, struct mmsghdr *msgvec, unsigned int vlen, + unsigned int flags, struct timespec *timeout)); COBALT_DECL(ssize_t, sendmsg, (int fd, const struct msghdr *msg, int flags));
Signature · 1 line
2.39.5
Quoted 10 lines · Florian Bezdeka
The macro usage was broken for the following services:
- recvmmsg
-mq_timedsend
-mq_timedreceiveThe message queue services were forwarded to wrong libc functions, the recvmmsg was missing the correct routing.
Detected while trying to remove the function wrapping at all.
Can you elaborate a bit on the visible impact for users? And it affects 3.3 only?
Jan
Quoted 44 lines
Signed-off-by Florian Bezdeka <[email protected]>--- include/cobalt/mqueue.h | 4 ++-- include/cobalt/sys/socket.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)include/cobalt/mqueue.h +2
-2@@ -42,14 +42,14 @@ COBALT_DECL(int, mq_setattr,COBALT_DECL (int, mq_send, (mqd_t qd, const char *buffer, size_t len, unsigned prio)); -COBALT_DECL_TIME64 (int, mq_timedsend, __mq_timedsend64, +COBALT_DECL_TIME64 (int, mq_timedsend, __mq_timedsend_time64, (mqd_t q, const char *buffer, size_t len, unsigned prio, const struct timespec *timeout));COBALT_DECL (ssize_t, mq_receive, (mqd_t q, char *buffer, size_t len, unsigned *prio)); -COBALT_DECL_TIME64 (ssize_t, mq_timedreceive, __mq_timedsend_time64, +COBALT_DECL_TIME64 (ssize_t, mq_timedreceive, __mq_timedreceive_time64, (mqd_t q, char *__restrict__ buffer, size_t len, unsigned *__restrict__ prio, const struct timespec *__restrict__ timeout));include/cobalt/sys/socket.h +3
-3@@ -31,9 +31,9 @@ COBALT_DECL(int, socket, (int protocol_family, int socket_type, int protocol)); COBALT_DECL(ssize_t, recvmsg, (int fd, struct msghdr *msg, int flags)); -COBALT_DECL (int, recvmmsg, - (int fd, struct mmsghdr *msgvec, unsigned int vlen, - unsigned int flags, struct timespec *timeout)); +COBALT_DECL_TIME64 (int, recvmmsg, __recvmmsg64, + (int fd, struct mmsghdr *msgvec, unsigned int vlen, + unsigned int flags, struct timespec *timeout)); COBALT_DECL(ssize_t, sendmsg, (int fd, const struct msghdr *msg, int flags));
Signature · 2 lines
Siemens AG, Technology Linux Expert Center
Quoted 6 lines · Jan Kiszka
Quoted 5 lines · Florian Bezdeka
The macro usage was broken for the following services:
- recvmmsg
-mq_timedsend
-mq_timedreceive
Quoted 8 lines
Quoted 5 lines
The message queue services were forwarded to wrong libc functions, the recvmmsg was missing the correct routing.
Detected while trying to remove the function wrapping at all.
Can you elaborate a bit on the visible impact for users? And it affects 3.3 only?
Yes, this is 3.3 only.
Something like __STD(recvmmsg()) had not the desired effect on compat applications with y2038 support enabled - which is the default for compat applications now.
Rare use case but still relevant I would say.
Florian
Quoted 51 lines
Jan
Quoted 44 lines
Signed-off-by Florian Bezdeka <[email protected]>--- include/cobalt/mqueue.h | 4 ++-- include/cobalt/sys/socket.h | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-)include/cobalt/mqueue.h +2
-2@@ -42,14 +42,14 @@ COBALT_DECL(int, mq_setattr,COBALT_DECL (int, mq_send, (mqd_t qd, const char *buffer, size_t len, unsigned prio)); -COBALT_DECL_TIME64 (int, mq_timedsend, __mq_timedsend64, +COBALT_DECL_TIME64 (int, mq_timedsend, __mq_timedsend_time64, (mqd_t q, const char *buffer, size_t len, unsigned prio, const struct timespec *timeout));COBALT_DECL (ssize_t, mq_receive, (mqd_t q, char *buffer, size_t len, unsigned *prio)); -COBALT_DECL_TIME64 (ssize_t, mq_timedreceive, __mq_timedsend_time64, +COBALT_DECL_TIME64 (ssize_t, mq_timedreceive, __mq_timedreceive_time64, (mqd_t q, char *__restrict__ buffer, size_t len, unsigned *__restrict__ prio, const struct timespec *__restrict__ timeout));include/cobalt/sys/socket.h +3
-3@@ -31,9 +31,9 @@ COBALT_DECL(int, socket, (int protocol_family, int socket_type, int protocol)); COBALT_DECL(ssize_t, recvmsg, (int fd, struct msghdr *msg, int flags)); -COBALT_DECL (int, recvmmsg, - (int fd, struct mmsghdr *msgvec, unsigned int vlen, - unsigned int flags, struct timespec *timeout)); +COBALT_DECL_TIME64 (int, recvmmsg, __recvmmsg64, + (int fd, struct mmsghdr *msgvec, unsigned int vlen, + unsigned int flags, struct timespec *timeout)); COBALT_DECL(ssize_t, sendmsg, (int fd, const struct msghdr *msg, int flags));Signature · 2 lines
Siemens AG, Technology Linux Expert Center
Quoted 16 lines · Florian Bezdeka
Quoted 6 lines · Jan Kiszka
Quoted 5 lines · Florian Bezdeka
The macro usage was broken for the following services:
- recvmmsg
-mq_timedsend
-mq_timedreceiveQuoted 8 lines
Quoted 5 lines
The message queue services were forwarded to wrong libc functions, the recvmmsg was missing the correct routing.
Detected while trying to remove the function wrapping at all.
Can you elaborate a bit on the visible impact for users? And it affects 3.3 only?
Quoted 8 lines
Yes, this is 3.3 only.
Something like __STD(recvmmsg()) had not the desired effect on compat applications with y2038 support enabled - which is the default for compat applications now.
Rare use case but still relevant I would say.
So, I wrote "The __STD macro usage was broken..." in the commit message while merging.
Thanks,
Jan
Signature · 2 lines
Siemens AG, Technology Linux Expert Center
Quoted 23 lines · Jan Kiszka
Quoted 22 lines · Florian Bezdeka
Quoted 6 lines · Jan Kiszka
Quoted 5 lines · Florian Bezdeka
The macro usage was broken for the following services:
- recvmmsg
-mq_timedsend
-mq_timedreceiveQuoted 8 lines
Quoted 5 lines
The message queue services were forwarded to wrong libc functions, the recvmmsg was missing the correct routing.
Detected while trying to remove the function wrapping at all.
Can you elaborate a bit on the visible impact for users? And it affects 3.3 only?
Yes, this is 3.3 only.
Something like __STD(recvmmsg()) had not the desired effect on compat applications with y2038 support enabled - which is the default for compat applications now.
Quoted 6 lines
Quoted 2 lines
Rare use case but still relevant I would say.
So, I wrote "The
__STDmacro usage was broken..." in the commit message while merging.
...which was already mentioned in the subject - missed that.
Jan
Signature · 2 lines
Siemens AG, Technology Linux Expert Center