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:	Sun, 1 Jun 2008 19:05:05 +0200
From:	Martin Mares <mj@....cz>
To:	Jiri Hladky <hladky.jiri@...glemail.com>
Cc:	linux-kernel@...r.kernel.org
Subject: Re: Bug in arch/i386/lib/delay.c file, delay_loop function

Hi!

> when trying to understand how Bogomips are implemented I have found
> bug in arch/i386/lib/delay.c file, delay_loop function
[...]

> The function fails for loops > 2^31+1. It because SF is set when dec
> returns numbers > 2^31
> 
> The fix is to use jnz instruction instead of jns (and add one decl
> instruction to the end to have exactly the same number of loops as in
> original version):

It is a long time since I have hacked that file, but you should definitely
make sure that the function is never called with a zero argument. In such
case, the original version made just a single pass, but your version
makes 2^32 of them.

				Have a nice fortnight
-- 
Martin `MJ' Mares                          <mj@....cz>   http://mj.ucw.cz/
Faculty of Math and Physics, Charles University, Prague, Czech Rep., Earth
Homo homini lupus, frater fratri lupior, bohemus bohemo lupissimus.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ