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]
Date:	Thu, 12 Dec 2013 10:28:36 -0000
From:	"David Laight" <David.Laight@...LAB.COM>
To:	"Yang Yingliang" <yangyingliang@...wei.com>, <davem@...emloft.net>,
	<netdev@...r.kernel.org>
Cc:	<fengguang.wu@...el.com>, <kbuild-all@...org>
Subject: RE: [PATCH resend net] sch_tbf: use do_div() for 64-bit divide

> From: Yang Yingliang
> It's doing a 64-bit divide which is not supported
> on 32-bit architectures in psched_ns_t2l(). The
> correct way to do this is to use do_div().

The 'len' value has just been divided by 1000000000, can
it actually be larger than 32bit when the divide by 53 is done?

...
>  	do_div(len, NSEC_PER_SEC);
> 
> -	if (unlikely(r->linklayer == TC_LINKLAYER_ATM))
> -		len = (len / 53) * 48;
> +	if (unlikely(r->linklayer == TC_LINKLAYER_ATM)) {
> +		do_div(len, 53);
> +		len = len * 48;
> +	}

	David



--
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