linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/kconfig/32: Mark CONFIG_VM86 as BROKEN
@ 2015-07-08  1:25 Andy Lutomirski
  2015-07-08  2:33 ` Arjan van de Ven
                   ` (2 more replies)
  0 siblings, 3 replies; 41+ messages in thread
From: Andy Lutomirski @ 2015-07-08  1:25 UTC (permalink / raw)
  To: x86, linux-kernel
  Cc: Oleg Nesterov, Kees Cook, Arjan van de Ven, Peter Zijlstra,
	Borislav Petkov, Linus Torvalds, Andy Lutomirski

VM86 is entirely broken if ptrace, syscall auditing, or NOHZ_FULL is
in use.  The code is a big undocumented mess, it's a real PITA to
test, and it looks like a big chunk of vm86_32.c is dead code.  It
also plays awful games with the entry asm.

No one should be using it anyway.  Use DOSBOX or KVM instead.

Mark it BROKEN.  I want to remove some (obviously incorrect) exit
asm that it depends on, and I don't want to figure out how to run
severely obsolete programs just to test something that no one uses
for anything other than exploits anyway.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---

I find it implausible that vm86_32.c isn't full or root holes.  It's
also full of hilariously ugly code, it does terrible things to the
kernel stack, and its interaction with the syscall slowpath is
blatantly incorrect.

It really shouldn't have any users, anyway.  It doesn't (and can't!)
work on 64-bit kernels, and the only program that even knows how it
works appears to be DOSEMU.  DOSEMU doesn't even need it for most
programs (it uses modify_ldt instead if possible), and DOSBOX and
KVM are better choices anyway.

I think that even DOSEMU might be able to emulate vm86 (by emulating
instruction-by-instruction) if the vm86 syscall isn't there.

Want to be terrified?  Read copy_vm86_regs_from_user.  Or
mark_screen_rdonly.  Or return_to_32bit.  Or VM86_REQUEST_IRQ.

What do you all think?  This code is a maintenance disaster, and I'd
love to see it go.  This would be a nice first step.

This patch is intended for tip/x86/asm.  The 32-bit part of my big
cleanup will interfere with vm86, and, while I think I fixed it up
right, I'd rather not expose everyone to the high probability of
crazy security bugs in this mess.

 arch/x86/Kconfig | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index aa94fd014fa2..080228bdbcda 100644
--- a/arch/x86/Kconfig
+++ b/arch/x86/Kconfig
@@ -997,8 +997,8 @@ config X86_THERMAL_VECTOR
 	depends on X86_MCE_INTEL
 
 config VM86
-	bool "Enable VM86 support" if EXPERT
-	default y
+	bool "Enable VM86 support" if BROKEN
+	default n
 	depends on X86_32
 	---help---
 	  This option is required by programs like DOSEMU to run
@@ -1006,6 +1006,12 @@ config VM86
 	  be needed by software like XFree86 to initialize some video
 	  cards via BIOS. Disabling this option saves about 6K.
 
+	  Linux's vm86 support is poorly maintained, essentially never
+	  tested by upstream kernel developers, has quite a few known
+	  bugs, and is probably full of security holes.  The only thing
+	  that appears to use it is DOSEMU, and DOSBOX and KVM are
+	  better options these days.  Don't enable it.
+
 config X86_16BIT
 	bool "Enable support for 16-bit segments" if EXPERT
 	default y
-- 
2.4.3


^ permalink raw reply related	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2015-07-11  9:18 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-08  1:25 [PATCH] x86/kconfig/32: Mark CONFIG_VM86 as BROKEN Andy Lutomirski
2015-07-08  2:33 ` Arjan van de Ven
2015-07-08 14:00   ` Thomas Gleixner
2015-07-08 14:04     ` Ingo Molnar
2015-07-09  9:03     ` Pavel Machek
2015-07-09 17:57       ` Andy Lutomirski
2015-07-09 18:03         ` Kees Cook
2015-07-09 18:30         ` Linus Torvalds
2015-07-08 16:59   ` Linus Torvalds
2015-07-08 17:30     ` Andy Lutomirski
2015-07-08 17:49       ` Andy Lutomirski
2015-07-08 17:55         ` Linus Torvalds
2015-07-08 18:47           ` Andy Lutomirski
2015-07-08 18:53             ` Kees Cook
2015-07-08 18:48           ` Kees Cook
2015-07-08 19:04             ` Andy Lutomirski
2015-07-08 18:54           ` Austin S Hemmelgarn
2015-07-08 19:05       ` Brian Gerst
2015-07-08 19:14         ` Andy Lutomirski
2015-07-08 19:39           ` Brian Gerst
2015-07-08 19:59             ` Andy Lutomirski
2015-07-09  5:52               ` Ingo Molnar
2015-07-09  5:59                 ` Ingo Molnar
2015-07-09 18:33                   ` Andy Lutomirski
2015-07-10 11:16                     ` Paolo Bonzini
2015-07-10 14:13                       ` Ingo Molnar
2015-07-10 14:24                         ` Paolo Bonzini
2015-07-10 14:39                       ` Andy Lutomirski
2015-07-10 14:12       ` Eric W. Biederman
2015-07-10 14:37         ` Andy Lutomirski
2015-07-10 16:35           ` Linus Torvalds
2015-07-10 16:44             ` Andy Lutomirski
2015-07-10 17:04               ` Linus Torvalds
2015-07-10 17:13                 ` Andy Lutomirski
2015-07-10 17:39                   ` Linus Torvalds
2015-07-10 17:58                     ` Andy Lutomirski
2015-07-10 18:00                     ` Al Viro
2015-07-11  9:18                     ` Ingo Molnar
2015-07-08 19:13     ` Ingo Molnar
2015-07-08  9:45 ` [tip:x86/asm] " tip-bot for Andy Lutomirski
2015-07-08 15:32 ` [PATCH] " Brian Gerst

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).