[PATCH v9] y2038: Introduce the __ASSUME_TIME64_SYSCALLS define
Rich Felker
dalias@libc.org
Fri Aug 30 17:09:00 GMT 2019
On Fri, Aug 30, 2019 at 01:03:16PM -0400, Zack Weinberg wrote:
> On Fri, Aug 30, 2019 at 12:37 PM Joseph Myers <joseph@codesourcery.com> wrote:
> > On Fri, 30 Aug 2019, Rich Felker wrote:
> > > To clarify, none of the timespec ones "exactly match" -- the suffixed
> > > syscalls on 32-bit require filling the padding around tv_nsec, whereas
> >
> > What do you mean by "require filling the padding"? I thought the
> > conclusion in the kernel was that it dealt with zeroing the padding
> ....
>
> The kernel should always explicitly clear all of the padding in any
> structure it writes to user space, anything else risks leaking kernel
> data (e.g. the compiler decides it can use a 64-bit load and store to
> copy from the kernel's struct timespec to the user space struct
> timespec because those high bits are don't-care in the destination
> .... oops, the previous allocation had a kernel pointer in that 64-bit
> slot and we just exposed the KASLR base).
The issue is the other direction, when timespecs are passed to the
kernel (usually for read-only access), e.g. providing a timeout.
Rich
More information about the Libc-alpha
mailing list