All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philippe Gerum <rpm@xenomai.org>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: xenomai@xenomai.org, Florian Bezdeka <florian.bezdeka@siemens.com>
Subject: Re: [PATCH 2/8] cobalt/mutex: Bring back ia32 support for mutex_timedwait
Date: Wed, 07 Apr 2021 18:57:07 +0200	[thread overview]
Message-ID: <87v98ynicc.fsf@xenomai.org> (raw)
In-Reply-To: <12f269c4-cd8f-3235-60a9-6f5029fe1529@siemens.com>


Jan Kiszka <jan.kiszka@siemens.com> writes:

> On 27.03.21 10:54, Philippe Gerum wrote:
>> From: Florian Bezdeka <florian.bezdeka@siemens.com>
>> 
>> 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,
>> 
>
> Also here: Can we please avoid introducing a regression first and then
> fixing it in the same series? To my understanding, this belongs into
> patch 1, right?
>
> Same for patch 3 and 8 likely.
>
> Philippe, you can preserve Florian's fix-up credit simply in the commit
> message, if that was the concern.

That was the concern.

-- 
Philippe.


  reply	other threads:[~2021-04-07 16:57 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-27  9:54 [PATCH 0/8] y2038 groundwork Philippe Gerum
2021-03-27  9:54 ` [PATCH 1/8] cobalt/kernel: y2038: convert struct timespec to timespec64 Philippe Gerum
2021-03-27  9:54 ` [PATCH 2/8] cobalt/mutex: Bring back ia32 support for mutex_timedwait Philippe Gerum
2021-04-07 16:35   ` Jan Kiszka
2021-04-07 16:57     ` Philippe Gerum [this message]
2021-03-27  9:54 ` [PATCH 3/8] cobalt/mqueue: Bring back ia32 support for mq_timed{send, receive} Philippe Gerum
2021-03-27  9:54 ` [PATCH 4/8] lib: y2038: convert to internal timespec type Philippe Gerum
2021-03-30 21:20   ` Florian Bezdeka
2021-03-31  8:13     ` Philippe Gerum
2021-03-31  9:03     ` Philippe Gerum
2021-03-31 15:58       ` Florian Bezdeka
2021-03-27  9:54 ` [PATCH 5/8] cobalt/kernel: y2038: convert struct itimerspec to itimerspec64 Philippe Gerum
2021-03-27  9:54 ` [PATCH 6/8] cobalt/kernel: y2038: convert struct timex to __kernel_timex Philippe Gerum
2021-03-27  9:54 ` [PATCH 7/8] cobalt/kernel: y2038: switch to new legacy type names Philippe Gerum
2021-03-27  9:54 ` [PATCH 8/8] cobalt/sem: y2038: Fixing the sem_timedwait syscall for 32 bit systems Philippe Gerum

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v98ynicc.fsf@xenomai.org \
    --to=rpm@xenomai.org \
    --cc=florian.bezdeka@siemens.com \
    --cc=jan.kiszka@siemens.com \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.