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: <1456691730.648.51.camel@edumazet-ThinkPad-T530>
Date:	Sun, 28 Feb 2016 12:35:30 -0800
From:	Eric Dumazet <eric.dumazet@...il.com>
To:	Tom Herbert <tom@...bertland.com>
Cc:	davem@...emloft.net, netdev@...r.kernel.org,
	torvalds@...ux-foundation.org, tglx@...utronix.de,
	mingo@...hat.com, hpa@...or.com, x86@...nel.org, kernel-team@...com
Subject: Re: [PATCH v4 net-next] net: Implement fast csum_partial for x86_64

On ven., 2016-02-26 at 12:03 -0800, Tom Herbert wrote:
> +
> +	/*
> +	 * Length is greater than 64. Sum to eight byte alignment before
> +	 * proceeding with main loop.
> +	 */
> +	aligned = !!((unsigned long)buff & 0x1);
> +	if (aligned) {
> +		unsigned int align = 7 & -(unsigned long)buff;
> +
> +		result = csum_partial_lt8_head(*(unsigned long *)buff, align);
> +		buff += align;
> +		len -= align;
> +		result = rotate_by8_if_odd(result, align);
> +	}
> +

This looks like you wanted to test 3 low order bits, not only the 1 low
order.

aligned = !((unsigned long)buff & 0x7);

if (!aligned) {
 ...
}

Or rename the variable to notaligned




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ