From: Arnd Bergmann <arnd@arndb.de>
To: y2038@lists.linaro.org
Cc: klibc@zytor.com, libc-alpha@sourceware.org,
linux-api@vger.kernel.org, musl@lists.openwall.com,
linux-kernel@vger.kernel.org, Rich Felker <dalias@libc.org>,
Thorsten Glaser <tg@mirbsd.de>,
cferris@google.com, enh@google.com,
"Joseph S. Myers" <joseph@codesourcery.com>
Subject: Re: [klibc] kernel/libc uapi changes for y2038
Date: Mon, 18 May 2015 22:35:40 +0200 [thread overview]
Message-ID: <3622889.d8DplXjbu8@wuerfel> (raw)
In-Reply-To: <Pine.BSM.4.64L.1505181658330.32668@herc.mirbsd.org>
On Monday 18 May 2015 17:03:08 Thorsten Glaser wrote:
> >MIPS on the other hand is no more broken than any of the other 32-bit
> >ABIs, because it does not use 64-bit __kernel_long_t in its n32 ABI.
>
> I have heard from a MIPS porter that one of the flavours suffers
> from similar problems as x32, just not to that extent. But I
> don’t recall my source…
MIPS n32 has a lot of the same issues as x86 x32, but I'm pretty
sure that the time_t one is not among them.
> >ioctls. My plan at this point is to eliminate all uses of time_t in
> >the kernel and replace them with time64_t or other safe types.
> >This way, we will eventually find all code that passes 32-bit time types
> >to user space and can fix it. This will take care of the time_t
> >related problems on x32 as well.
>
> Ah, interesting approach. And existing userspace, as well as new
> userspace that does not declare 64-bit time_t readiness, is still
> safe on currently-not-broken architectures? So, there’s enough time
> to fix this before the various libcs turn that on (and it had better
> be fixed by then, because it becomes ABI by then). Nice idea.
Correct. Another aspect of the approach I'm taking is that the
system-call implementation is shared between the native 64-bit
case and the new 32-bit case, while the handling for the existing
syscalls on 32-bit architectures is shared with the 32-bit compat
code on 64-bit architectures. This means if we introduce a bug
in either of them, we will find out very quickly and don't have
to wait until people start using 64-bit time_t on 32-bit user land.
> I am wondering a bit about the ioctls being hard to find. I have
> not much experience with kernel programming, and even less with
> Linux than with MS-DOS and BSD, but should not each driver have
> a central ioctl entry point, from which it should cast the user
> space data into a (possibly locally declared) structure?
Yes, that's how it works, but unfortunately we have a few thousand
drivers that declare an ioctl function, and I hope to do something
better than brute-force search all of them. The other point is that
we really need to fix all y2038-related bug in drivers, not just
the ones in ioctl. This includes things like file systems storing
time in 32-bit units on disk, or drivers trying to measure how much
time has elapsed without communicating that value elsewhere, but
failing when the time_t number goes negative.
Arnd
_______________________________________________
Y2038 mailing list
Y2038@lists.linaro.org
https://lists.linaro.org/mailman/listinfo/y2038
WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: y2038@lists.linaro.org
Cc: Thorsten Glaser <tg@mirbsd.de>,
klibc@zytor.com, libc-alpha@sourceware.org,
linux-api@vger.kernel.org, musl@lists.openwall.com,
linux-kernel@vger.kernel.org, Rich Felker <dalias@libc.org>,
cferris@google.com, enh@google.com,
"Joseph S. Myers" <joseph@codesourcery.com>
Subject: Re: [Y2038] [klibc] kernel/libc uapi changes for y2038
Date: Mon, 18 May 2015 22:35:40 +0200 [thread overview]
Message-ID: <3622889.d8DplXjbu8@wuerfel> (raw)
In-Reply-To: <Pine.BSM.4.64L.1505181658330.32668@herc.mirbsd.org>
On Monday 18 May 2015 17:03:08 Thorsten Glaser wrote:
> >MIPS on the other hand is no more broken than any of the other 32-bit
> >ABIs, because it does not use 64-bit __kernel_long_t in its n32 ABI.
>
> I have heard from a MIPS porter that one of the flavours suffers
> from similar problems as x32, just not to that extent. But I
> don’t recall my source…
MIPS n32 has a lot of the same issues as x86 x32, but I'm pretty
sure that the time_t one is not among them.
> >ioctls. My plan at this point is to eliminate all uses of time_t in
> >the kernel and replace them with time64_t or other safe types.
> >This way, we will eventually find all code that passes 32-bit time types
> >to user space and can fix it. This will take care of the time_t
> >related problems on x32 as well.
>
> Ah, interesting approach. And existing userspace, as well as new
> userspace that does not declare 64-bit time_t readiness, is still
> safe on currently-not-broken architectures? So, there’s enough time
> to fix this before the various libcs turn that on (and it had better
> be fixed by then, because it becomes ABI by then). Nice idea.
Correct. Another aspect of the approach I'm taking is that the
system-call implementation is shared between the native 64-bit
case and the new 32-bit case, while the handling for the existing
syscalls on 32-bit architectures is shared with the 32-bit compat
code on 64-bit architectures. This means if we introduce a bug
in either of them, we will find out very quickly and don't have
to wait until people start using 64-bit time_t on 32-bit user land.
> I am wondering a bit about the ioctls being hard to find. I have
> not much experience with kernel programming, and even less with
> Linux than with MS-DOS and BSD, but should not each driver have
> a central ioctl entry point, from which it should cast the user
> space data into a (possibly locally declared) structure?
Yes, that's how it works, but unfortunately we have a few thousand
drivers that declare an ioctl function, and I hope to do something
better than brute-force search all of them. The other point is that
we really need to fix all y2038-related bug in drivers, not just
the ones in ioctl. This includes things like file systems storing
time in 32-bit units on disk, or drivers trying to measure how much
time has elapsed without communicating that value elsewhere, but
failing when the time_t number goes negative.
Arnd
next prev parent reply other threads:[~2015-05-18 20:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-18 9:53 kernel/libc uapi changes for y2038 Arnd Bergmann
2015-05-18 12:16 ` [klibc] " Thorsten Glaser
2015-05-18 12:16 ` Thorsten Glaser
2015-05-18 13:32 ` [Y2038] " Arnd Bergmann
2015-05-18 17:03 ` Thorsten Glaser
2015-05-18 17:03 ` [Y2038] " Thorsten Glaser
2015-05-18 20:35 ` Arnd Bergmann [this message]
2015-05-18 20:35 ` Arnd Bergmann
2015-05-19 17:54 ` [Y2038] " John Stultz
2015-05-27 15:28 ` [klibc] " H. Peter Anvin
[not found] ` <5565E2AC.3070306-YMNOUZJC4hwAvxtiuMwx3w@public.gmane.org>
2015-05-27 20:19 ` Arnd Bergmann
2015-05-27 20:19 ` 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=3622889.d8DplXjbu8@wuerfel \
--to=arnd@arndb.de \
--cc=cferris@google.com \
--cc=dalias@libc.org \
--cc=enh@google.com \
--cc=joseph@codesourcery.com \
--cc=klibc@zytor.com \
--cc=libc-alpha@sourceware.org \
--cc=linux-api@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=musl@lists.openwall.com \
--cc=tg@mirbsd.de \
--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 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.