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  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ee0cf01638074abfbddda7edd3074d2c@AcuMS.aculab.com>
Date:   Fri, 23 Jun 2023 10:52:58 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Edward Cree' <ecree.xilinx@...il.com>,
        Arnd Bergmann <arnd@...nel.org>,
        Martin Habets <habetsm.xilinx@...il.com>,
        "David S. Miller" <davem@...emloft.net>,
        Eric Dumazet <edumazet@...gle.com>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>
CC:     Arnd Bergmann <arnd@...db.de>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-net-drivers@....com" <linux-net-drivers@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 3/3] sfc: selftest: fix struct packing

...
> Duplicating the definition isn't the prettiest thing in the world; it'd
>  do for a quick fix if needed but I assume W=1 warnings aren't blocking
>  anyone, so maybe defer this one for now and I'll follow up soon with a
>  rewrite that fixes this more cleanly?  My idea is to drop the __packed
>  from the containing struct, make efx_begin_loopback() copy the layers
>  separately, and efx_loopback_rx_packet() similarly do something less
>  direct than casting the packet data to the struct.

Maybe you can get away with adding a 16bit pad before the ethernet
header so that the IP header is actually aligned.

(Then fight all the stuff that stops you doing a memcpy()
that runs into a second field of a structure.)

Failing that maybe a single shared copy of the misaligned
IP header.

I also suspect you could just add __packed to the two 32bit
address fields.
That would generate better code on systems that care.

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ