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: <20080731144920.0016e02d.akpm@linux-foundation.org>
Date:	Thu, 31 Jul 2008 14:49:20 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Krzysztof Helt <krzysztof.h1@...pl>
Cc:	hpa@...or.com, linux-kernel@...r.kernel.org,
	Ingo Molnar <mingo@...e.hu>,
	Jeremy Fitzhardinge <jeremy@...p.org>
Subject: Re: [PATCH] x86: fdiv bug detection fix

On Thu, 31 Jul 2008 23:43:44 +0200
Krzysztof Helt <krzysztof.h1@...pl> wrote:

> From: Krzysztof Helt <krzysztof.h1@...pl>
> 
> The fdiv detection code writes s32 integer into
> the boot_cpu_data.fdiv_bug. 
> However, the boot_cpu_data.fdiv_bug is only char (s8)
> field so the detection overwrites already set fields for
> other bugs, e.g. the f00f bug field.
> 
> Use local s32 variable to receive result.
> 
> Signed-off-by: Krzysztof Helt <krzysztof.h1@...pl>
> ---
> 
> This is a partial fix to Bugzilla #9928  - fixes wrong 
> information about the f00f bug (tested) and probably
> for coma bug (I have no cpu to test this).
> 
> diff -urp linux-alsa/arch/x86/kernel/cpu/bugs.c linux-new/arch/x86/kernel/cpu/bugs.c
> --- linux-alsa/arch/x86/kernel/cpu/bugs.c	2008-07-31 12:40:31.000000000 +0200
> +++ linux-new/arch/x86/kernel/cpu/bugs.c	2008-07-31 23:24:07.722657435 +0200
> @@ -50,6 +50,8 @@ static double __initdata y = 3145727.0;
>   */
>  static void __init check_fpu(void)
>  {
> +	s32 fdiv_bug;
> +
>  	if (!boot_cpu_data.hard_math) {
>  #ifndef CONFIG_MATH_EMULATION
>  		printk(KERN_EMERG "No coprocessor found and no math emulation present.\n");
> @@ -74,8 +76,10 @@ static void __init check_fpu(void)
>  		"fistpl %0\n\t"
>  		"fwait\n\t"
>  		"fninit"
> -		: "=m" (*&boot_cpu_data.fdiv_bug)
> +		: "=m" (*&fdiv_bug)
>  		: "m" (*&x), "m" (*&y));
> +
> +	boot_cpu_data.fdiv_bug = fdiv_bug;
>  	if (boot_cpu_data.fdiv_bug)
>  		printk("Hmm, FPU with FDIV bug.\n");
>  }

hm, the code seems to have been that way for quite some time.  I wonder
why nobody noticed this before.  
--
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