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: <alpine.DEB.2.10.1402052224200.2702@minerva.lan>
Date:	Wed, 5 Feb 2014 22:26:24 -0700 (MST)
From:	Nate Eldredge <nate@...tsmathematics.com>
To:	Suresh Siddha <sbsiddha@...il.com>
cc:	Linus Torvalds <torvalds@...ux-foundation.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...nel.org>,
	"H. Peter Anvin" <hpa@...or.com>,
	the arch/x86 maintainers <x86@...nel.org>,
	stable <stable@...r.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Maarten Baert <maarten-baert@...mail.com>,
	Jan Kara <jack@...e.cz>, George Spelvin <linux@...izon.com>,
	Pekka Riikonen <priikone@....fi>
Subject: Re: [PATCH] Make math_state_restore() save and restore the interrupt
 flag

On Sun, 2 Feb 2014, Suresh Siddha wrote:

> Here is the second patch, which should fix the issue reported in this
> thread. Maarten, Nate, George, please give this patch a try as is and
> see if it helps address the issue you ran into. And please ack/review
> with your test results.

3.13 plus this patch: boots and fixes the testcase I reported (core dump 
on ecrypt).

Tested-by: Nate Eldredge <nate@...tsmathematics.com>

> diff --git a/arch/x86/kernel/i387.c b/arch/x86/kernel/i387.c
> index 4e5f770..670bba1 100644
> --- a/arch/x86/kernel/i387.c
> +++ b/arch/x86/kernel/i387.c
> @@ -87,10 +87,19 @@ EXPORT_SYMBOL(__kernel_fpu_begin);
>
> void __kernel_fpu_end(void)
> {
> -	if (use_eager_fpu())
> -		math_state_restore();
> -	else
> +	if (use_eager_fpu()) {
> +		/*
> +		 * For eager fpu, most the time, tsk_used_math() is true.
> +		 * Restore the user math as we are done with the kernel usage.
> +		 * At few instances during thread exit, signal handling etc,
> +		 * tsk_used_math() is false. Those few places will take proper
> +		 * actions, so we don't need to restore the math here.
> +		 */
> +		if (likely(tsk_used_math(current)))
> +			math_state_restore();
> +	} else {
> 		stts();
> +	}
> }
> EXPORT_SYMBOL(__kernel_fpu_end);

-- 
Nate Eldredge
nate@...tsmathematics.com

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