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]
Date:	Tue, 16 Dec 2014 00:42:06 -0800
From:	Joe Perches <joe@...ches.com>
To:	Krzysztof Adamski <k@...ko.eu>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Malcolm Priestley <tvboxspy@...il.com>,
	Forest Bond <forest@...ttletooquiet.net>,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: vt6656: Use ether_addr_copy() in
 vnt_fill_ieee80211_rts.

On Tue, 2014-12-16 at 09:30 +0100, Krzysztof Adamski wrote:
> Both struct ieee80211_rts and struct ieee80211_hdr defined in
> linux/ieee80211.h are declared as __aligned(2) so it is safe to use
> ether_addr_copy() instead of memcpy().

Just fyi:

That the structure is declared __aligned(2) is not
the important bit.  What's necessary is that the
members in the struct are __aligned(2).

In this case, all of these members are.

> diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c
[]
> @@ -392,8 +393,8 @@ static int vnt_fill_ieee80211_rts(struct vnt_usb_send_context *tx_context,
>   	rts->frame_control =
>   		cpu_to_le16(IEEE80211_FTYPE_CTL | IEEE80211_STYPE_RTS);
>   
> -	memcpy(rts->ra, hdr->addr1, ETH_ALEN);
> -	memcpy(rts->ta, hdr->addr2, ETH_ALEN);
> +	ether_addr_copy(rts->ra, hdr->addr1);
> +	ether_addr_copy(rts->ta, hdr->addr2);



--
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