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]
Date:	Sun, 6 Sep 2015 14:37:23 -0500
From:	Larry Finger <Larry.Finger@...inger.net>
To:	Shraddha Barke <shraddha.6596@...il.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Florian Schilhabel <florian.c.schilhabel@...glemail.com>,
	Mateusz Kulikowski <mateusz.kulikowski@...il.com>,
	Aya Mahfouz <mahfouz.saif.elyazal@...il.com>,
	Julia Lawall <julia.lawall@...6.fr>,
	Sudip Mukherjee <sudipm.mukherjee@...il.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/3] Staging: rtl8712: Replace memcpy by ether_addr_copy

On 09/06/2015 02:04 PM, Shraddha Barke wrote:
> This patch replaces memcpy by ethr_addr_copy
>
> The change was made using Coccinelle
>
> @@ expression e1, e2; @@
> - memcpy(e1, e2, ETH_ALEN);
> + ether_addr_copy(e1, e2);
>
> Signed-off-by: Shraddha Barke <shraddha.6596@...il.com>
> ---
>   drivers/staging/rtl8712/rtl871x_mp_ioctl.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Your commit message has a typo.

More seriously, ether_addr_copy() requires that both arguments be u16 aligned. 
This condition is not hard to meet, but I see no indication in your commit 
message that you have checked this requirement. As a result, I must NACK this patch.

Coccinelle is a wonderful tool, but the user must exercise judgment when 
applying the results.

Larry

Larry

>
> diff --git a/drivers/staging/rtl8712/rtl871x_mp_ioctl.c b/drivers/staging/rtl8712/rtl871x_mp_ioctl.c
> index 77f01bf..76c1cfe 100644
> --- a/drivers/staging/rtl8712/rtl871x_mp_ioctl.c
> +++ b/drivers/staging/rtl8712/rtl871x_mp_ioctl.c
> @@ -167,7 +167,7 @@ static int mp_start_test(struct _adapter *padapter)
>   	int res = _SUCCESS;
>
>   	/* 3 1. initialize a new struct wlan_bssid_ex */
> -	memcpy(bssid.MacAddress, pmppriv->network_macaddr, ETH_ALEN);
> +	ether_addr_copy(bssid.MacAddress, pmppriv->network_macaddr);
>   	bssid.Ssid.SsidLength = 16;
>   	memcpy(bssid.Ssid.Ssid, (unsigned char *)"mp_pseudo_adhoc",
>   		bssid.Ssid.SsidLength);
>

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ