]> git.baikalelectronics.ru Git - kernel.git/commit
x86-64, modify_ldt: Ban 16-bit segments on 64-bit kernels
authorH. Peter Anvin <hpa@linux.intel.com>
Sun, 16 Mar 2014 22:31:54 +0000 (15:31 -0700)
committerH. Peter Anvin <hpa@linux.intel.com>
Fri, 11 Apr 2014 17:10:09 +0000 (10:10 -0700)
commit860c5a5b610ee7c5a0ad2d805503f91b3c76ff33
treeb611f0f4d789f79ef1b0b9056aae923327a18687
parent50df17c91dc85f631cc82e118836c5e845fe9758
x86-64, modify_ldt: Ban 16-bit segments on 64-bit kernels

The IRET instruction, when returning to a 16-bit segment, only
restores the bottom 16 bits of the user space stack pointer.  We have
a software workaround for that ("espfix") for the 32-bit kernel, but
it relies on a nonzero stack segment base which is not available in
32-bit mode.

Since 16-bit support is somewhat crippled anyway on a 64-bit kernel
(no V86 mode), and most (if not quite all) 64-bit processors support
virtualization for the users who really need it, simply reject
attempts at creating a 16-bit segment when running on top of a 64-bit
kernel.

Cc: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Link: http://lkml.kernel.org/n/tip-kicdm89kzw9lldryb1br9od0@git.kernel.org
Cc: <stable@vger.kernel.org>
arch/x86/kernel/ldt.c