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  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:	Sat, 1 Feb 2014 11:27:54 -0800
From:	Linus Torvalds <>
To:	Suresh Siddha <>
Cc:	Nate Eldredge <>,
	Thomas Gleixner <>,
	Ingo Molnar <>,
	"H. Peter Anvin" <>,
	"the arch/x86 maintainers" <>,
	stable <>,
	Linux Kernel Mailing List <>,
	Maarten Baert <>,
	Jan Kara <>, George Spelvin <>,
	Pekka Riikonen <>
Subject: Re: [PATCH] Make math_state_restore() save and restore the interrupt flag

On Thu, Jan 30, 2014 at 11:33 PM, Suresh Siddha <> wrote:
> a. delayed dynamic allocation of FPU state area was not a good idea
> (from me). Given most of the future cases will be anyway using eager
> FPU (because of processor features like xsaveopt etc, applications
> implicitly using FPU because of optimizations in commonly used
> libraries etc), we should probably go back to allocation of FPU state
> area during thread creation for everyone (including non-eager cases).

Yes, I suspect that will help some, and probably fix this particular bug.

That said, regardless of the allocation issue, I do think that it's
stupid for kernel_fpu_{begin,end} to save the math state if
"used_math" was not set.  So I do think__kernel_fpu_end() as-s is
buggy and stupid. So I do think we should *either* say

 (a) "we don't want to restore at all, because once the kernel starts
using math, it might do so a lot, and saving/restoring is a bad idea":

  void __kernel_fpu_end(void)


 (b) make the use_eager_fpu() case check tsk_used_math() (in which
case we had better already have an allocation!)

  void __kernel_fpu_end(void)
          if (use_eager_fpu()) {
                  struct task_struct *me = current;

                  if (tsk_used_math(me) && likely(!restore_fpu_checking(me)))

Quite frankly, I'd almost lean towards (a). Comments? Does anybody
have any loads where the kernel does a lot of fpu stuff (ie network
encryption using the hw engines or something)? I'd really like to hear
if it makes a difference..

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

Powered by blists - more mailing lists