s390: always save and restore all registers on context switch
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Mon, 20 Nov 2017 11:38:44 +0000 (12:38 +0100)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 5 Dec 2017 06:51:08 +0000 (07:51 +0100)
commitfbbd7f1a51965b50dd12924841da0d478f3da71b
tree6d290a0620b413c21eae4366cfe0c3082d329d42
parentbd7a9b3757895c3a2fd64b3f12e438d9190c83d9
s390: always save and restore all registers on context switch

The switch_to() macro has an optimization to avoid saving and
restoring register contents that aren't needed for kernel threads.

There is however the possibility that a kernel thread execve's a user
space program. In such a case the execve'd process can partially see
the contents of the previous process, which shouldn't be allowed.

To avoid this, simply always save and restore register contents on
context switch.

Cc: <stable@vger.kernel.org> # v2.6.37+
Fixes: fdb6d070effba ("switch_to: dont restore/save access & fpu regs for kernel threads")
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/switch_to.h