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] [day] [month] [year] [list]
Message-Id: <20200928.160307.1327269757816527615.davem@davemloft.net>
Date:   Mon, 28 Sep 2020 16:03:07 -0700 (PDT)
From:   David Miller <davem@...emloft.net>
To:     W_Armin@....de
Cc:     netdev@...r.kernel.org
Subject: Re: [PATCH net-next] lib8390: Replace panic() call with
 BUILD_BUG_ON

From: Armin Wolf <W_Armin@....de>
Date: Sun, 27 Sep 2020 21:56:59 +0200

> Replace panic() call in lib8390.c with BUILD_BUG_ON()
> since checking the size of struct e8390_pkt_hdr should
> happen at compile-time. Also add __packed to e8390_pkt_hdr
> to prevent padding.
> 
> Signed-off-by: Armin Wolf <W_Armin@....de>
> ---
>  drivers/net/ethernet/8390/8390.h    | 2 +-
>  drivers/net/ethernet/8390/lib8390.c | 4 ++--
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/net/ethernet/8390/8390.h b/drivers/net/ethernet/8390/8390.h
> index e52264465998..e7d6fd55f6a5 100644
> --- a/drivers/net/ethernet/8390/8390.h
> +++ b/drivers/net/ethernet/8390/8390.h
> @@ -21,7 +21,7 @@ struct e8390_pkt_hdr {
>  	unsigned char status; /* status */
>  	unsigned char next;   /* pointer to next packet. */
>  	unsigned short count; /* header + packet length in bytes */
> -};
> +} __packed;

This is completely unnecessary and hurts performance on some cpus as
__packed forces the compiler to be unable to assume the alignment of
any member of said data structure.

I'm not applying this.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ