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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200427120301.693525a5@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date:   Mon, 27 Apr 2020 12:03:01 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Igor Russkikh <irusskikh@...vell.com>
Cc:     David Miller <davem@...emloft.net>, <netdev@...r.kernel.org>,
        Mark Starovoytov <mstarovoitov@...vell.com>,
        Dmitry Bogdanov <dbogdanov@...vell.com>
Subject: Re: [EXT] Re: [PATCH net-next 08/17] net: atlantic: A2
 driver-firmware interface

On Mon, 27 Apr 2020 18:38:21 +0300 Igor Russkikh wrote:
> >>>  
> >>>> On Fri, 24 Apr 2020 10:27:20 +0300 Igor Russkikh wrote:  
> >>>>> +/* Start of HW byte packed interface declaration */
> >>>>> +#pragma pack(push, 1)  
> >>>>
> >>>> Does any structure here actually require packing?  
> >>>
> >>> Yes, please use the packed attribute as an absolute _last_ resort.  
> >>
> >> These are HW bit-mapped layout API, without packing compiler may screw  
> > up  
> >> alignments in some of these structures.  
> > 
> > The compiler will not do that if you used fixed sized types properly.
> > 
> > Please remove __packed unless you can prove it matters.  
> 
> Just double checked the layout without packed pragma, below is what pahole
> diff gives just on one structure.

Okay, then mark the appropriate fields of that structure as packed.
I looked at first 4 structures and they should require no packing.

> Compiler does obviously insert cache optimization holes without pragmas.
> And since these structures are HW mapped API - this all will not work without
> pack(1).

Hm. These are not "cache optimization holes", just alignment.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ