x86/tls: Validate TLS entries to protect espfix
authorAndy Lutomirski <luto@amacapital.net>
Fri, 5 Dec 2014 00:48:16 +0000 (16:48 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Jan 2015 17:58:15 +0000 (09:58 -0800)
commit359d2d755e1924fc7231d8423696a7365eccd3e1
treeecf33e577df16731c27e7e2da51c2e0d8a01d3df
parent1fe5620fcd6c2f0a4a927ee10c8e53196da392f3
x86/tls: Validate TLS entries to protect espfix

commit 41bdc78544b8a93a9c6814b8bbbfef966272abbe upstream.

Installing a 16-bit RW data segment into the GDT defeats espfix.
AFAICT this will not affect glibc, Wine, or dosemu at all.

Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Acked-by: H. Peter Anvin <hpa@zytor.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Willy Tarreau <w@1wt.eu>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/tls.c