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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 11 Apr 2009 00:46:56 +0530
From:	Jaswinder Singh Rajput <jaswinder@...nel.org>
To:	Sam Ravnborg <sam@...nborg.org>
Cc:	Pavel Machek <pavel@....cz>, Ingo Molnar <mingo@...e.hu>,
	x86 maintainers <x86@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>, josh@...edesktop.org
Subject: Re: [PATCH -tip] x86: acpi/sleep.c saved_magic fix overflow

On Fri, 2009-04-10 at 21:13 +0200, Sam Ravnborg wrote:
> On Fri, Apr 10, 2009 at 07:55:45PM +0200, Pavel Machek wrote:
> > On Fri 2009-04-10 23:06:55, Jaswinder Singh Rajput wrote:
> > > Impact: fix overflow
> > 
> > > Constant 0x123456789abcdef0 is so big for a long.
> > > So using saved_magic 0x12345678 for both 32 and 64 bit.
> > 
> > Have you tested the patch? I have feeling that this is tested from
> > assembly... Plus it is only set to long constant on 64-bit, so I don't
> > think you are fixing anything. And if your code is correct the
> > variable is write only...
> 
> $ git grep saved_magic
> kernel/acpi/sleep.c:    saved_magic = 0x12345678;
> kernel/acpi/sleep.c:    saved_magic = 0x123456789abcdef0;
> kernel/acpi/sleep.h:extern long saved_magic;
> kernel/acpi/wakeup_32.S:        movl    %cs:saved_magic, %eax
> kernel/acpi/wakeup_32.S:ENTRY(saved_magic)      .long   0
> kernel/acpi/wakeup_64.S:        movq    saved_magic, %rax
> kernel/acpi/wakeup_64.S:ENTRY(saved_magic)      .quad   0
> 
> 
> wakeup_32.S:
>         movl    %cs:saved_magic, %eax
>         cmpl    $0x12345678, %eax
> 
> wakeup_64.S:
>         movq    saved_magic, %rax
>         movq    $0x123456789abcdef0, %rdx
> 
> So patch is obviously bogus.
> 

Sorry, I was confused by this sparse warning on 64 bit box:

CHECK   arch/x86/kernel/acpi/sleep.c
 arch/x86/kernel/acpi/sleep.c:107:16: warning: constant 0x123456789abcdef0 is so big it is long

atleast I found problem in sparse ;-)

--
JSR



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