x86, tls, ldt: Stop checking lm in LDT_empty
Andy Lutomirski authored
commit e30ab185 upstream.

32-bit programs don't have an lm bit in their ABI, so they can't
reliably cause LDT_empty to return true without resorting to memset.
They shouldn't need to do this.

This should fix a longstanding, if minor, issue in all 64-bit kernels
as well as a potential regression in the TLS hardening code.

Fixes: 41bdc785

 x86/tls: Validate TLS entries to protect espfix
Signed-off-by: default avatarAndy Lutomirski <luto@amacapital.net>
Cc: torvalds@linux-foundation.org
Link: http://lkml.kernel.org/r/72a059de55e86ad5e2935c80aa91880ddf19d07c.1421954363.git.luto@amacapital.net

Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
(cherry picked from commit f62570cb

)
Signed-off-by: default avatarWilly Tarreau <w@1wt.eu>
598b6280