public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Florian Weimer <fweimer@redhat.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Adhemerval Zanella <adhemerval.zanella@linaro.org>,
	 Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>,
	Zack Weinberg <zack@owlfolio.org>
Subject: Re: [PATCH] linux: Use 'long int' for timespec tv_nsec on x32 (BZ #16437)
Date: Fri, 10 Dec 2021 13:48:03 +0100	[thread overview]
Message-ID: <CAK8P3a1MoNRG+5HoOag97+eqFLVXOf-kNxpJfocLEO-drqAa2A@mail.gmail.com> (raw)
In-Reply-To: <87czm4bsvw.fsf@oldenburg.str.redhat.com>

On Fri, Dec 10, 2021 at 12:29 PM Florian Weimer <fweimer@redhat.com> wrote:
> > On Thu, Dec 9, 2021 at 8:35 PM Adhemerval Zanella via Libc-alpha
> > <libc-alpha@sourceware.org> wrote:
> >> On 09/12/2021 16:19, Florian Weimer wrote: * Adhemerval Zanella via Libc-alpha:
> >
> >> > The change is also not entirely ABI-compatible because existing code on
> >> > x32 depends on the implementation clearing the upper 32 bits, and if new
> >> > code copies around structs, it won't necessary copy the zero bits.
> >>
> >> Afaiu the high-bits clearing is strictly necessary on kABI boundary for
> >> set functions.  Some issues indeed might arise if user use timespec
> >> embedded in some function and mix objects built with different glibc
> >> version, but it is similar to 32-bit architectures with mixing time_t
> >> objects.
> >
> > The kernel's 32-bit ABI ignores the upper 32 bits of tv_nsec for structures
> > passed from user space, but zeroes them when returning a timespec to user
> > space.
>
> And that zeroing may get lost if the struct has padding.  That's my
> concern.

Which struct? I am talking about __kernel_timespec, which has
no padding on any architecture, and this is what gets used in the uabi
headers.

       Arnd

  reply	other threads:[~2021-12-10 12:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-09 19:10 Adhemerval Zanella
2021-12-09 19:19 ` Florian Weimer
2021-12-09 19:35   ` Adhemerval Zanella
2021-12-10 11:23     ` Arnd Bergmann
2021-12-10 11:29       ` Florian Weimer
2021-12-10 12:48         ` Arnd Bergmann [this message]
2021-12-10 12:51           ` Florian Weimer
2021-12-10 13:11             ` 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=CAK8P3a1MoNRG+5HoOag97+eqFLVXOf-kNxpJfocLEO-drqAa2A@mail.gmail.com \
    --to=arnd@arndb.de \
    --cc=adhemerval.zanella@linaro.org \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=zack@owlfolio.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 read-only IMAP folder(s) and NNTP newsgroup(s).