diff options
author | H. Peter Anvin <hpa@zytor.com> | 2014-05-04 19:36:22 +0200 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2014-05-04 21:27:37 +0200 |
commit | 34273f41d57ee8d854dcd2a1d754cbb546cb548f (patch) | |
tree | 0f3fee911ac04263045d3c1557dd5ba452dc9658 /arch/x86/kernel/ldt.c | |
parent | x86, espfix: Make espfix64 a Kconfig option, fix UML (diff) | |
download | linux-34273f41d57ee8d854dcd2a1d754cbb546cb548f.tar.xz linux-34273f41d57ee8d854dcd2a1d754cbb546cb548f.zip |
x86, espfix: Make it possible to disable 16-bit support
Embedded systems, which may be very memory-size-sensitive, are
extremely unlikely to ever encounter any 16-bit software, so make it
a CONFIG_EXPERT option to turn off support for any 16-bit software
whatsoever.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Link: http://lkml.kernel.org/r/1398816946-3351-1-git-send-email-hpa@linux.intel.com
Diffstat (limited to 'arch/x86/kernel/ldt.c')
-rw-r--r-- | arch/x86/kernel/ldt.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/arch/x86/kernel/ldt.c b/arch/x86/kernel/ldt.c index ebc987398923..c37886d759cc 100644 --- a/arch/x86/kernel/ldt.c +++ b/arch/x86/kernel/ldt.c @@ -229,6 +229,11 @@ static int write_ldt(void __user *ptr, unsigned long bytecount, int oldmode) } } + if (!IS_ENABLED(CONFIG_X86_16BIT) && !ldt_info.seg_32bit) { + error = -EINVAL; + goto out_unlock; + } + fill_ldt(&ldt, &ldt_info); if (oldmode) ldt.avl = 0; |