All of lore.kernel.org
 help / color / mirror / Atom feed
* [wip/dovetail][PATCH 0/2] Bring back ia32 support for some
@ 2021-03-11 16:38 Florian Bezdeka
  2021-03-11 16:38 ` [wip/dovetail][PATCH 1/2] cobalt/mutex: Bring back ia32 support for mutex_timedwait Florian Bezdeka
  2021-03-11 16:38 ` [wip/dovetail][PATCH 2/2] cobalt/mqueue: Bring back ia32 support for mq_timed{send, receive} Florian Bezdeka
  0 siblings, 2 replies; 3+ messages in thread
From: Florian Bezdeka @ 2021-03-11 16:38 UTC (permalink / raw)
  To: xenomai, rpm, jan.kiszka, chensong

As Jan mentioned that he needs a first test based on davtail I thought
it might make sense to push that out...

That is the follow up of some topics detected while scanning the code
base for y2038 affected syscalls. Compile-time tested only so far and for
wip/dovetail branches only.

Florian Bezdeka (2):
  cobalt/mutex: Bring back ia32 support for mutex_timedwait
  cobalt/mqueue: Bring back ia32 support for mq_timed{send,receive}

 kernel/cobalt/posix/mqueue.c | 3 +--
 kernel/cobalt/posix/mutex.c  | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

-- 
2.29.2



^ permalink raw reply	[flat|nested] 3+ messages in thread

* [wip/dovetail][PATCH 1/2] cobalt/mutex: Bring back ia32 support for mutex_timedwait
  2021-03-11 16:38 [wip/dovetail][PATCH 0/2] Bring back ia32 support for some Florian Bezdeka
@ 2021-03-11 16:38 ` Florian Bezdeka
  2021-03-11 16:38 ` [wip/dovetail][PATCH 2/2] cobalt/mqueue: Bring back ia32 support for mq_timed{send, receive} Florian Bezdeka
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Bezdeka @ 2021-03-11 16:38 UTC (permalink / raw)
  To: xenomai, rpm, jan.kiszka, chensong

The helper used for copying the timeout values (=mutex_fetch_timeout())
was always copying sizeof(struct timespec64) from user to kernel space.
For applications with time_t being 4 bytes only (like for native 32 bit
applications) that is simply too much.

Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
---
 kernel/cobalt/posix/mutex.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/cobalt/posix/mutex.c b/kernel/cobalt/posix/mutex.c
index d43a747b3..70fe7960a 100644
--- a/kernel/cobalt/posix/mutex.c
+++ b/kernel/cobalt/posix/mutex.c
@@ -349,8 +349,7 @@ COBALT_SYSCALL(mutex_lock, primary,
 static inline int mutex_fetch_timeout(struct timespec64 *ts,
 				      const void __user *u_ts)
 {
-	return u_ts == NULL ? -EFAULT :
-		cobalt_copy_from_user(ts, u_ts, sizeof(*ts));
+	return u_ts == NULL ? -EFAULT : cobalt_get_u_timespec(ts, u_ts);
 }
 
 COBALT_SYSCALL(mutex_timedlock, primary,
-- 
2.29.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [wip/dovetail][PATCH 2/2] cobalt/mqueue: Bring back ia32 support for mq_timed{send, receive}
  2021-03-11 16:38 [wip/dovetail][PATCH 0/2] Bring back ia32 support for some Florian Bezdeka
  2021-03-11 16:38 ` [wip/dovetail][PATCH 1/2] cobalt/mutex: Bring back ia32 support for mutex_timedwait Florian Bezdeka
@ 2021-03-11 16:38 ` Florian Bezdeka
  1 sibling, 0 replies; 3+ messages in thread
From: Florian Bezdeka @ 2021-03-11 16:38 UTC (permalink / raw)
  To: xenomai, rpm, jan.kiszka, chensong

The helper used for copying the timeout values (=mq_fetch_timeout())
was always copying sizeof(struct timespec64) from user to kernel space.
For applications with time_t being 4 bytes only (like for native 32 bit
applications) that is simply too much.

Signed-off-by: Florian Bezdeka <florian.bezdeka@siemens.com>
---
 kernel/cobalt/posix/mqueue.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/kernel/cobalt/posix/mqueue.c b/kernel/cobalt/posix/mqueue.c
index b2cf92e43..296124b4e 100644
--- a/kernel/cobalt/posix/mqueue.c
+++ b/kernel/cobalt/posix/mqueue.c
@@ -883,8 +883,7 @@ COBALT_SYSCALL(mq_getattr, current,
 static inline int mq_fetch_timeout(struct timespec64 *ts,
 				   const void __user *u_ts)
 {
-	return u_ts == NULL ? -EFAULT :
-		cobalt_copy_from_user(ts, u_ts, sizeof(*ts));
+	return u_ts == NULL ? -EFAULT : cobalt_get_u_timespec(ts, u_ts);
 }
 
 int __cobalt_mq_timedsend(mqd_t uqd, const void __user *u_buf, size_t len,
-- 
2.29.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-11 16:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 16:38 [wip/dovetail][PATCH 0/2] Bring back ia32 support for some Florian Bezdeka
2021-03-11 16:38 ` [wip/dovetail][PATCH 1/2] cobalt/mutex: Bring back ia32 support for mutex_timedwait Florian Bezdeka
2021-03-11 16:38 ` [wip/dovetail][PATCH 2/2] cobalt/mqueue: Bring back ia32 support for mq_timed{send, receive} Florian Bezdeka

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.