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:	Mon, 2 Jun 2008 12:00:19 +0200
From:	"Jiri Hladky" <hladky.jiri@...glemail.com>
To:	"Ingo Molnar" <mingo@...e.hu>
Cc:	linux-kernel@...r.kernel.org, "Martin Mares" <mj@....cz>
Subject: Re: Bug in arch/i386/lib/delay.c file, delay_loop function

Hi Ingo, hi Martin!

As Martin correctly pointed out, my code will fail when loops=0. So I
have added a fix for this.

The patch file is attached:

diff -up arch/x86/lib/delay_32.c-orig arch/x86/lib/delay_32.c > delay_32.c_patch

I'm attaching also both kernel source codes (delay_32.c-orig and
delay_32.c) for reference.

Thanks
Jiri

On Sun, Jun 1, 2008 at 7:05 PM, Martin Mares <mj@....cz> wrote:
> 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.
>

Download attachment "delay_32.c_patch" of type "application/octet-stream" (1205 bytes)

Download attachment "linux-2.6.25.4-delay_32.c_patch.tar.bz2" of type "application/x-bzip2" (2061 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ