ARM: 7403/1: tls: remove covert channel via TPIDRURW
authorWill Deacon <will.deacon@arm.com>
Fri, 27 Apr 2012 11:45:07 +0000 (12:45 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 May 2012 15:56:37 +0000 (08:56 -0700)
commit62a17c9c34a40907e250b5ac110a5c64325f0aef
tree1e5a3106b07e8e4446f692a39d3c69a8462b78e6
parent70403b35a5e2d08c9e2727b2e8dd78cb0b1391b3
ARM: 7403/1: tls: remove covert channel via TPIDRURW

commit 6a1c53124aa161eb624ce7b1e40ade728186d34c upstream.

TPIDRURW is a user read/write register forming part of the group of
thread registers in more recent versions of the ARM architecture (~v6+).

Currently, the kernel does not touch this register, which allows tasks
to communicate covertly by reading and writing to the register without
context-switching affecting its contents.

This patch clears TPIDRURW when TPIDRURO is updated via the set_tls
macro, which is called directly from __switch_to. Since the current
behaviour makes the register useless to userspace as far as thread
pointers are concerned, simply clearing the register (rather than saving
and restoring it) will not cause any problems to userspace.

Signed-off-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