]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Sat, 28 Apr 2012 10:01:30 +0000 (11:01 +0100)
commit1cbada5f41fc338acd65a3eddb3fe9964f26316c
treede0b665b261df06bede794a469f9aa931af39d9d
parent5064fc4274b40b01fc72d795c8ee1dffe8c0b5da
ARM: 7403/1: tls: remove covert channel via TPIDRURW

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.

Cc: stable@vger.kernel.org
Signed-off-by: Will Deacon <will.deacon@arm.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/include/asm/tls.h