lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 9 Jul 2019 15:55:18 -0700
From:   Alistair Francis <alistair23@...il.com>
To:     Arnd Bergmann <arnd@...db.de>
Cc:     Alistair Francis <alistair.francis@....com>,
        linux-riscv-bounces@...ts.infradead.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/2] riscv/include/uapi: Define a custom __SIGINFO struct
 for RV32

On Thu, Jul 4, 2019 at 1:34 AM Arnd Bergmann <arnd@...db.de> wrote:
>
> On Thu, Jul 4, 2019 at 12:18 AM Alistair Francis <alistair23@...il.com> wrote:
> > On Wed, Jul 3, 2019 at 12:47 PM Arnd Bergmann <arnd@...db.de> wrote:
> > > On Wed, Jul 3, 2019 at 8:45 PM Alistair Francis <alistair23@...il.com> wrote:
> > > > What I don't understand though is how that impacted this struct, it
> > > > doesn't use clock_t at all, everything in the struct is an int or
> > > > void*.
> > >
> > > si_utime/si_stime in siginfo are clock_t.
> >
> > But they are further down the struct. I just assumed that GCC would
> > align those as required, I guess it aligns the start of the struct to
> > match some 64-bit members which seems strange.
>
> These are the regular struct alignment rules. Essentially you would
> get something like
>
> struct s {
>     int a;
>     int b;
>     int c;
>     union {
>          int d;
>          long long e;
>    };
>    int f;
> };
>
> Since 'e' has 8 byte alignment, the same is true for the union,
> and putting the union in a struct also requires the same alignment
> for the struct itself, so now you get padding after 'c' and 'f'.

Now that I think about it more it does make sense. Thanks for the help
with this and all the glibc stuff.

I have a new patch set that seems to work on RV32 and RV64. I'm now
hitting issues with syscalls that glibc doesn't use but other projects
do like io_getevents in OpenSSL.

Alistair

>
>        Arnd

Powered by blists - more mailing lists