Files
linux/arch/x86/include/asm
Peter Zijlstra 45fe6deee2 sched/x86: Save [ER]FLAGS on context switch
commit 6690e86be8 upstream.

Effectively reverts commit:

  2c7577a758 ("sched/x86_64: Don't save flags on context switch")

Specifically because SMAP uses FLAGS.AC which invalidates the claim
that the kernel has clean flags.

In particular; while preemption from interrupt return is fine (the
IRET frame on the exception stack contains FLAGS) it breaks any code
that does synchonous scheduling, including preempt_enable().

This has become a significant issue ever since commit:

  5b24a7a2aa ("Add 'unsafe' user access functions for batched accesses")

provided for means of having 'normal' C code between STAC / CLAC,
exposing the FLAGS.AC state. So far this hasn't led to trouble,
however fix it before it comes apart.

Reported-by: Julien Thierry <julien.thierry@arm.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: stable@kernel.org
Fixes: 5b24a7a2aa ("Add 'unsafe' user access functions for batched accesses")
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-05-21 18:48:56 +02:00
..
2018-10-13 09:18:58 +02:00
2014-12-11 11:35:02 +01:00
2015-05-28 15:31:53 +02:00
2014-03-04 21:47:51 +01:00
2015-10-21 11:17:32 +02:00
2018-01-05 15:46:32 +01:00
2018-08-17 20:59:28 +02:00
2015-04-24 15:36:55 +02:00
2018-01-05 15:46:35 +01:00
2016-08-18 18:41:27 +02:00
2016-01-12 12:17:28 +01:00
2015-07-31 13:31:10 +02:00
2017-06-07 12:07:47 +02:00
2014-02-27 08:07:39 -08:00
2018-02-13 12:36:00 +01:00
2015-12-19 11:53:40 +01:00
2018-11-10 07:43:01 -08:00
2014-09-01 10:15:31 +02:00
2016-09-20 09:26:15 +02:00
2015-05-19 15:47:30 +02:00
2016-01-30 11:22:17 +01:00
2016-09-05 11:47:31 +02:00
2016-06-16 00:04:31 +02:00
2016-06-16 00:04:31 +02:00
2015-05-19 15:47:30 +02:00