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: <1461343880.7627.34.camel@edumazet-glaptop3.roam.corp.google.com>
Date:	Fri, 22 Apr 2016 09:51:20 -0700
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Nicolas Dichtel <nicolas.dichtel@...nd.com>
Cc:	netdev@...r.kernel.org, davem@...emloft.net,
	linux-kernel@...r.kernel.org, linux-wpan@...r.kernel.org,
	aar@...gutronix.de, pablo@...filter.org, kaber@...sh.net,
	kadlec@...ckhole.kfki.hu, pshelar@...ira.com, kuznet@....inr.ac.ru,
	jmorris@...ei.org, yoshfuji@...ux-ipv6.org,
	netfilter-devel@...r.kernel.org, dev@...nvswitch.org,
	steffen.klassert@...unet.com, herbert@...dor.apana.org.au,
	bsingharora@...il.com
Subject: Re: [PATCH net-next 2/9] libnl: nla_put_le64(): align on a 64-bit
 area

On Fri, 2016-04-22 at 17:31 +0200, Nicolas Dichtel wrote:
> nla_data() is now aligned on a 64-bit area.
> 
> Signed-off-by: Nicolas Dichtel <nicolas.dichtel@...nd.com>
> ---
>  include/net/netlink.h     |  8 +++++---
>  include/net/nl802154.h    |  6 ++++++
>  net/ieee802154/nl802154.c | 13 ++++++++-----
>  3 files changed, 19 insertions(+), 8 deletions(-)
> 
> diff --git a/include/net/netlink.h b/include/net/netlink.h
> index 6f51a8a06498..7f6b99483ab7 100644
> --- a/include/net/netlink.h
> +++ b/include/net/netlink.h
> @@ -878,14 +878,16 @@ static inline int nla_put_net64(struct sk_buff *skb, int attrtype, __be64 value)
>  }
>  
>  /**
> - * nla_put_le64 - Add a __le64 netlink attribute to a socket buffer
> + * nla_put_le64 - Add a __le64 netlink attribute to a socket buffer and align it
>   * @skb: socket buffer to add attribute to
>   * @attrtype: attribute type
>   * @value: numeric value
> + * @padattr: attribute type for the padding
>   */
> -static inline int nla_put_le64(struct sk_buff *skb, int attrtype, __le64 value)
> +static inline int nla_put_le64(struct sk_buff *skb, int attrtype, __le64 value,
> +			       int padattr)
>  {
> -	return nla_put(skb, attrtype, sizeof(__le64), &value);
> +	return nla_put_64bit(skb, attrtype, sizeof(__le64), &value, padattr);
>  }
>  

But _why_ is it needed ?

nla_put() has no alignment assumptions, it simply copies 8 bytes.

Seems this is going too far.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ