ARM: 8148/1: flush TLS and thumbee register state during exec
authorNathan Lynch <nathan_lynch@mentor.com>
Thu, 11 Sep 2014 01:49:08 +0000 (02:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 5 Oct 2014 21:52:16 +0000 (14:52 -0700)
commitd164cc67d028228ac8f216930aec3442c47321bc
tree1fe5bac568e29f24ca91e8a705a737da38c78e64
parent7c2fbe441dc19dc9a701b1bc4c588ca97091792b
ARM: 8148/1: flush TLS and thumbee register state during exec

commit fbfb872f5f417cea48760c535e0ff027c88b507a upstream.

The TPIDRURO and TPIDRURW registers need to be flushed during exec;
otherwise TLS information is potentially leaked.  TPIDRURO in
particular needs careful treatment.  Since flush_thread basically
needs the same code used to set the TLS in arm_syscall, pull that into
a common set_tls helper in tls.h and use it in both places.

Similarly, TEEHBR needs to be cleared during exec as well.  Clearing
its save slot in thread_info isn't right as there is no guarantee
that a thread switch will occur before the new program runs.  Just
setting the register directly is sufficient.

Signed-off-by: Nathan Lynch <nathan_lynch@mentor.com>
Acked-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/include/asm/tls.h
arch/arm/kernel/process.c
arch/arm/kernel/thumbee.c
arch/arm/kernel/traps.c