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: <57168225.2040507@6wind.com>
Date:	Tue, 19 Apr 2016 21:08:21 +0200
From:	Nicolas Dichtel <nicolas.dichtel@...nd.com>
To:	Eric Dumazet <eric.dumazet@...il.com>,
	David Miller <davem@...emloft.net>
Cc:	roopa@...ulusnetworks.com, netdev@...r.kernel.org,
	jhs@...atatu.com, tgraf@...g.ch
Subject: Re: [PATCH net-next v5] rtnetlink: add new RTM_GETSTATS message to
 dump link stats

Le 19/04/2016 20:47, Eric Dumazet a écrit :
> On Tue, 2016-04-19 at 14:31 -0400, David Miller wrote:
>
>> +#ifndef HAVE_EFFICIENT_UNALIGNED_ACCESS
>> +	/* IF necessary, add a zero length NOP attribute so that the
>> +	 * nla_data() of the IFLA_STATS64 will be 64-bit aligned.
>> +	 *
>> +	 * The nlattr header is 4 bytes in size, that's why we test
>> +	 * if the skb->data _is_ aligned.  This NOP attribute, plus
>> +	 * nlattr header for IFLA_STATS64, will make nla_data() 8-byte
>> +	 * aligned.
>> +	 */
>> +	if (IS_ALIGNED((unsigned long)skb->data, 8)) {
>> +		attr = nla_reserve(skb, IFLA_PAD, 0);
>> +		if (!attr)
>> +			return -EMSGSIZE;
>> +	}
>> +#endif
>
> Since we want to use this in other places, we could define a helper.
>
> nla_align_64bit(skb, attribute)  or something.
Yes, with the corresponding nla_total_size_64bit()

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ