[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87a5qwz3dr.ffs@tglx>
Date: Wed, 29 Nov 2023 21:54:56 +0100
From: Thomas Gleixner <tglx@...utronix.de>
To: Wei Gao <wegao@...e.com>, mingo@...hat.com, peterz@...radead.org,
dvhart@...radead.org, dave@...olabs.net, andrealmeid@...lia.com,
linux-kernel@...r.kernel.org
Cc: wei gao <wegao@...e.com>
Subject: Re: [PATCH v1] futex: Add compat_sys_futex_waitv for 32bit
compatibility
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
Powered by blists - more mailing lists