From: Arnd Bergmann <arnd@arndb.de>
To: Christoph Hellwig <hch@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
y2038 Mailman List <y2038@lists.linaro.org>,
Linux API <linux-api@vger.kernel.org>,
linux-arch <linux-arch@vger.kernel.org>,
GNU C Library <libc-alpha@sourceware.org>,
Albert ARIBAUD <albert.aribaud@3adev.fr>,
Networking <netdev@vger.kernel.org>,
Al Viro <viro@zeniv.linux.org.uk>,
Peter Zijlstra <peterz@infradead.org>,
Darren Hart <dvhart@infradead.org>,
"Eric W . Biederman" <ebiederm@xmission.com>,
Dominik Brodowski <linux@dominikbrodowski.net>
Subject: Re: [PATCH v2 06/17] y2038: Change sys_utimensat() to use __kernel_timespec
Date: Tue, 17 Jul 2018 16:27:26 +0200 [thread overview]
Message-ID: <CAK8P3a2eQJMDUpB7FdXYDm9LDD2puLCcW-XShBhhccsm9bbYrw@mail.gmail.com> (raw)
In-Reply-To: <20180717125243.GE25416@infradead.org>
On Tue, Jul 17, 2018 at 2:52 PM, Christoph Hellwig <hch@infradead.org> wrote:
> On Mon, Jul 16, 2018 at 06:10:52PM +0200, Arnd Bergmann wrote:
>> When 32-bit architectures get changed to support 64-bit time_t,
>> utimensat() needs to use the new __kernel_timespec structure as its
>> argument.
>>
>> The older utime(), utimes() and futimesat() system calls don't need a
>> corresponding change as they are no longer used on C libraries that have
>> 64-bit time support.
>>
>> As we do for the other syscalls that have timespec arguments, we reuse
>> the 'compat' syscall entry points to implement the traditional four
>> interfaces, and only leave the new utimensat() as a native handler,
>> so that the same code gets used on both 32-bit and 64-bit kernels
>> on each syscall.
>
> I wonder about the direction here: wouldn't it be easier to just
> leave th existing syscall names as-is and introduce a new utimesat64
> which uses the new timespec? We can then drop the old legacy utimesat
> for new architectures added after the cutover.
We have debated both approaches over several years, but for
most syscalls, we picked the approach described above, for multiple
reasons:
- For any system call that takes a time_t derived argument, we
already have two implementations (native and compat), so adding a
third one requires duplicating some code.
- I want to avoid adding an implementation that is not well tested
if possible, to make it less likely to introduce security holes or
subtle bugs that we can't fix later without breaking the ABI.
Using the same implementation for the new 32-bit case that
we have for the existing 64-bit case means that this code is
much better exercised, while reusing the compat code for the
traditional native syscall means it gets exercised by all current
user space, which makes it more likely to catch bugs early.
- Looking at the end result, I find it more logical to have each
of the converted syscalls implement the same binary interface
on both 32-bit and 64-bit architectures with the same code,
and have the old 32-bit implementation be similarly shared.
This is even more important once we add new architectures
that don't even provide the 32-bit time_t interfaces and just
leave out the old entry points.
Arnd
next prev parent reply other threads:[~2018-07-17 14:27 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-16 16:10 [PATCH v2 00/17] y2038: system calls, part 3 Arnd Bergmann
2018-07-16 16:10 ` [PATCH v2 01/17] y2038: compat: Move common compat types to asm-generic/compat.h Arnd Bergmann
2018-07-17 12:49 ` Christoph Hellwig
2018-07-16 16:10 ` [PATCH v2 02/17] y2038: Remove newstat family from default syscall set Arnd Bergmann
2018-07-17 12:50 ` Christoph Hellwig
2018-07-17 14:18 ` Arnd Bergmann
2018-07-18 20:15 ` Joseph Myers
2018-07-19 8:53 ` Arnd Bergmann
2018-07-16 16:10 ` [PATCH v2 03/17] y2038: Remove stat64 " Arnd Bergmann
2018-07-16 16:10 ` [PATCH v2 04/17] asm-generic: Remove unneeded __ARCH_WANT_SYS_LLSEEK macro Arnd Bergmann
2018-07-17 12:51 ` Christoph Hellwig
2018-07-16 16:10 ` [PATCH v2 05/17] asm-generic: Remove empty asm/unistd.h Arnd Bergmann
2018-07-17 12:51 ` Christoph Hellwig
2018-07-16 16:10 ` [PATCH v2 06/17] y2038: Change sys_utimensat() to use __kernel_timespec Arnd Bergmann
2018-07-17 12:52 ` Christoph Hellwig
2018-07-17 14:27 ` Arnd Bergmann [this message]
2018-07-16 16:10 ` [PATCH v2 07/17] y2038: Compile utimes()/futimesat() conditionally Arnd Bergmann
2018-07-16 16:10 ` [PATCH v2 08/17] y2038: utimes: Rework #ifdef guards for compat syscalls Arnd Bergmann
2018-07-16 16:10 ` [PATCH v2 09/17] y2038: futex: Move compat implementation into futex.c Arnd Bergmann
2018-07-16 16:10 ` [PATCH v2 10/17] y2038: futex: Add support for __kernel_timespec Arnd Bergmann
2018-07-16 16:10 ` [PATCH v2 11/17] y2038: Prepare sched_rr_get_interval " Arnd Bergmann
2018-07-16 16:10 ` [PATCH v2 12/17] y2038: aio: Prepare sys_io_{p,}getevents " Arnd Bergmann
2018-07-16 16:10 ` [PATCH v2 13/17] y2038: socket: Convert recvmmsg to __kernel_timespec Arnd Bergmann
2018-07-16 16:11 ` [PATCH v2 14/17] y2038: socket: Add compat_sys_recvmmsg_time64 Arnd Bergmann
2018-07-16 16:11 ` [PATCH v2 15/17] y2038: signal: Change rt_sigtimedwait to use __kernel_timespec Arnd Bergmann
2018-07-16 16:11 ` [PATCH v2 16/17] y2038: Make compat_sys_rt_sigtimedwait usable on 32-bit Arnd Bergmann
2018-07-16 16:11 ` [PATCH v2 17/17] y2038: signal: Add compat_sys_rt_sigtimedwait_time64 Arnd Bergmann
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=CAK8P3a2eQJMDUpB7FdXYDm9LDD2puLCcW-XShBhhccsm9bbYrw@mail.gmail.com \
--to=arnd@arndb.de \
--cc=albert.aribaud@3adev.fr \
--cc=dvhart@infradead.org \
--cc=ebiederm@xmission.com \
--cc=hch@infradead.org \
--cc=libc-alpha@sourceware.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux@dominikbrodowski.net \
--cc=netdev@vger.kernel.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=viro@zeniv.linux.org.uk \
--cc=y2038@lists.linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).