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: <1503590792.12569.2.camel@perches.com>
Date:   Thu, 24 Aug 2017 09:06:32 -0700
From:   Joe Perches <joe@...ches.com>
To:     Himanshu Jha <himanshujha199640@...il.com>, dledford@...hat.com
Cc:     sean.hefty@...el.com, hal.rosenstock@...il.com,
        linux-rdma@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] IB/core: replace memcpy with ether_addr_copy

On Thu, 2017-08-24 at 21:11 +0530, Himanshu Jha wrote:
> Use ether_addr_copy to copy an ethernet address of size ETH_ALEN
> instead of memcpy.
[]
diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
[]
> @@ -798,7 +798,7 @@ int rdma_addr_find_l2_eth_by_grh(const union ib_gid *sgid,
>  	if (ret)
>  		return ret;
>  
> -	memcpy(dmac, dev_addr.dst_dev_addr, ETH_ALEN);
> +	ether_addr_copy(dmac, dev_addr.dst_dev_addr);
>  	dev = dev_get_by_index(&init_net, dev_addr.bound_dev_if);
>  	if (!dev)
>  		return -ENODEV;
> @@ -831,7 +831,7 @@ int rdma_addr_find_smac_by_sgid(union ib_gid *sgid, u8 *smac, u16 *vlan_id)
>  	if (ret)
>  		return ret;
>  
> -	memcpy(smac, dev_addr.src_dev_addr, ETH_ALEN);
> +	ether_addr_copy(smac, dev_addr.src_dev_addr);
>  	return ret;
>  }
>  EXPORT_SYMBOL(rdma_addr_find_smac_by_sgid);

Both dmac and smac are function arguments.
What guarantees these to be
aligned properly?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ