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: <063D6719AE5E284EB5DD2968C1650D6DCFFC85F3@AcuExch.aculab.com>
Date:   Fri, 7 Apr 2017 11:25:04 +0000
From:   David Laight <David.Laight@...LAB.COM>
To:     'Ursula Braun' <ubraun@...ux.vnet.ibm.com>,
        "davem@...emloft.net" <davem@...emloft.net>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "linux-s390@...r.kernel.org" <linux-s390@...r.kernel.org>,
        "jwi@...ux.vnet.ibm.com" <jwi@...ux.vnet.ibm.com>,
        "schwidefsky@...ibm.com" <schwidefsky@...ibm.com>,
        "heiko.carstens@...ibm.com" <heiko.carstens@...ibm.com>,
        "raspl@...ux.vnet.ibm.com" <raspl@...ux.vnet.ibm.com>
Subject: RE: [PATCH net-next 5/7] s390/qeth: improve endianness handling

From: Ursula Braun
> Sent: 05 April 2017 09:40
> From: Hans Wippel <hwippel@...ux.vnet.ibm.com>
> 
> Avoid endianness warnings reported by sparse by (1) using endianness
> conversions for assigning and using network packet fields, and (2)
> removing unnecessary endianness conversions from qeth_l3_rebuild_skb. No
> functional changes.
> 
> Signed-off-by: Hans Wippel <hwippel@...ux.vnet.ibm.com>
> Signed-off-by: Ursula Braun <ubraun@...ux.vnet.ibm.com>
> ---
>  drivers/s390/net/qeth_core.h      |  4 ++--
>  drivers/s390/net/qeth_core_main.c | 11 +++++-----
>  drivers/s390/net/qeth_l3_main.c   | 46 +++++++++++++++++++--------------------
>  drivers/s390/net/qeth_l3_sys.c    |  4 ++--
>  4 files changed, 33 insertions(+), 32 deletions(-)
> 
> diff --git a/drivers/s390/net/qeth_core.h b/drivers/s390/net/qeth_core.h
> index 22aa2cd..6764ab9 100644
> --- a/drivers/s390/net/qeth_core.h
> +++ b/drivers/s390/net/qeth_core.h
> @@ -844,9 +844,9 @@ static inline int qeth_get_ip_version(struct sk_buff *skb)
>  {
>  	__be16 *p = &((struct ethhdr *)skb->data)->h_proto;
> 
> -	if (*p == ETH_P_8021Q)
> +	if (be16_to_cpu(*p) == ETH_P_8021Q)
>  		p += 2;
> -	switch (*p) {
> +	switch (be16_to_cpu(*p)) {
>  	case ETH_P_IPV6:

These are definitely 'functional changes' on LE systems.

Also it is generally better to byteswap the constants.

	David

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ