All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Wei Gao <wegao@suse.com>,
	mingo@redhat.com, peterz@infradead.org, dvhart@infradead.org,
	dave@stgolabs.net, andrealmeid@igalia.com,
	linux-kernel@vger.kernel.org
Cc: wei gao <wegao@suse.com>
Subject: Re: [PATCH v1] futex: Add compat_sys_futex_waitv for 32bit compatibility
Date: Wed, 29 Nov 2023 21:54:56 +0100	[thread overview]
Message-ID: <87a5qwz3dr.ffs@tglx> (raw)
In-Reply-To: <20231123053140.16062-1-wegao@suse.com>

On Thu, Nov 23 2023 at 00:31, Wei Gao wrote:
> The new function copy main logic of current sys_futex_waitv, just update parameter
> type from "struct __kernel_timespec __user *" to "struct old_timespec32 __user *,"
> and use get_old_timespec32 within the new function to get timeout
> value.

That's not how it works.

struct __kernel_timespec is the same on 64bit and 32bit syscalls.

User space has to use the proper type when invoking a syscall and and
not just decide that it can use something arbitrary.

All new syscalls which deal with time use the Y2038 aware data types and
do not have compat fallbacks because there is no requirement to have
them.

If user space want's to use struct timespec on 32bit nevertheless in the
programm for a new syscall, which is obviously stupid in the context of
Y2038, then it's a user space problem to convert back and forth between
the two data types.

Fix LTP to be Y2038 safe instead.

Thanks,

        tglx

  parent reply	other threads:[~2023-11-29 20:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-23  5:31 [PATCH v1] futex: Add compat_sys_futex_waitv for 32bit compatibility Wei Gao
2023-11-23 16:09 ` André Almeida
2023-11-27 12:15   ` Wei Gao
2023-11-29 18:56     ` André Almeida
2023-12-01  6:39       ` Wei Gao
2023-11-24 13:19 ` kernel test robot
2023-11-29 20:54 ` Thomas Gleixner [this message]
2023-12-01  6:49   ` Wei Gao

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=87a5qwz3dr.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=andrealmeid@igalia.com \
    --cc=dave@stgolabs.net \
    --cc=dvhart@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=wegao@suse.com \
    /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.