summaryrefslogtreecommitdiff
path: root/arch/arm/kernel/thumbee.c
diff options
context:
space:
mode:
authorNathan Lynch <nathan_lynch@mentor.com>2014-09-11 02:49:08 +0100
committerJiri Slaby <jslaby@suse.cz>2014-10-13 15:41:07 +0200
commit3443c6fd1de2485cbd3e94ac35e54586a8ecc69f (patch)
treea21a9b94f871cedc5d9680f31e5f22b65d144820 /arch/arm/kernel/thumbee.c
parent132f8be98a83c38b1c63a8962ce63c31e28fd763 (diff)
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: Jiri Slaby <jslaby@suse.cz>
Diffstat (limited to 'arch/arm/kernel/thumbee.c')
-rw-r--r--arch/arm/kernel/thumbee.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/arm/kernel/thumbee.c b/arch/arm/kernel/thumbee.c
index 7b8403b76666..80f0d69205e7 100644
--- a/arch/arm/kernel/thumbee.c
+++ b/arch/arm/kernel/thumbee.c
@@ -45,7 +45,7 @@ static int thumbee_notifier(struct notifier_block *self, unsigned long cmd, void
switch (cmd) {
case THREAD_NOTIFY_FLUSH:
- thread->thumbee_state = 0;
+ teehbr_write(0);
break;
case THREAD_NOTIFY_SWITCH:
current_thread_info()->thumbee_state = teehbr_read();