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:	Thu, 11 Jun 2015 15:31:11 +0200
From:	Ivan Vecera <ivecera@...hat.com>
To:	Joe Perches <joe@...ches.com>
CC:	netdev@...r.kernel.org, rasesh.mody@...gic.com
Subject: Re: [PATCH net-next 01/19] bna: use ether_addr_copy instead of memcpy

On 06/10/2015 07:57 PM, Joe Perches wrote:
> On Wed, 2015-06-10 at 18:43 +0200, Ivan Vecera wrote:
>> Signed-off-by: Ivan Vecera <ivecera@...hat.com>
>
> Have you verified that all of these are __aligned(2)?
>
> I haven't, but you should verify that you have in the
> commit log.
I have checked an alignment of all instances and they are all aligned 
properly... An exception is global variable bnad_bcast_addr, its 
alignment is 1 according __alignof__ but according generated assembly it 
is aligned to 2. Anyway I'm going to put __aligned directive for sure.

> btw: this use looks odd to me:
>
> static int
> bnad_set_mac_address(struct net_device *netdev, void *mac_addr)
> {
> 	int err;
> 	struct bnad *bnad = netdev_priv(netdev);
> 	struct sockaddr *sa = (struct sockaddr *)mac_addr;
> 	unsigned long flags;
>
> 	spin_lock_irqsave(&bnad->bna_lock, flags);
>
> 	err = bnad_mac_addr_set_locked(bnad, sa->sa_data);
>
> as it casts what seems to be a mac address to a
> sockaddr and uses a different offset for sa->sa_data
> than the mac_addr passed.
>
> and the mac_addr as it's void doesn't need a cast.
No, bnad_set_mac_address() is an implementation of 
.ndo_set_mac_address() and this is called with pointer to struct 
sockaddr. The mac_addr name is a little bit confusing.

Will post v2.

Ivan

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ