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] [day] [month] [year] [list]
Date:   Wed, 31 Aug 2016 10:34:18 -0700
From:   Joe Perches <joe@...ches.com>
To:     Mani Sadhasivam <manivannanece23@...il.com>,
        gregkh@...uxfoundation.org
Cc:     linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Staging: rtl8712: Prefer ether_addr_copy

On Wed, 2016-08-31 at 22:48 +0530, Mani Sadhasivam wrote:
> This patch fixes the checkpatch.pl warning to prefer
> ether_addr_copy over memcpy

If you've verified that src & dst are _always_ __aligned(2),
(have you?, if so, please show that in the commit message)
then the other uses of memcmp and such should also be converted.

> diff --git a/drivers/staging/rtl8712/rtl871x_recv.c b/drivers/staging/rtl8712/rtl871x_recv.c
[]
> @@ -352,11 +352,11 @@ static sint sta2sta_data_frame(struct _adapter *adapter,
>  			sta_addr = pattrib->src;
>  		}
>  	} else if (check_fwstate(pmlmepriv, WIFI_MP_STATE)) {
> -		memcpy(pattrib->dst, GetAddr1Ptr(ptr), ETH_ALEN);
> -		memcpy(pattrib->src, GetAddr2Ptr(ptr), ETH_ALEN);
> -		memcpy(pattrib->bssid, GetAddr3Ptr(ptr), ETH_ALEN);
> -		memcpy(pattrib->ra, pattrib->dst, ETH_ALEN);
> -		memcpy(pattrib->ta, pattrib->src, ETH_ALEN);
> +		ether_addr_copy(pattrib->dst, GetAddr1Ptr(ptr));
> +		ether_addr_copy(pattrib->src, GetAddr2Ptr(ptr));
> +		ether_addr_copy(pattrib->bssid, GetAddr3Ptr(ptr));
> +		ether_addr_copy(pattrib->ra, pattrib->dst);
> +		ether_addr_copy(pattrib->ta, pattrib->src);

[etc...]

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ