Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754126AbbGISEK (ORCPT ); Thu, 9 Jul 2015 14:04:10 -0400 Received: from mail-ie0-f178.google.com ([209.85.223.178]:36748 "EHLO mail-ie0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754594AbbGISD0 (ORCPT ); Thu, 9 Jul 2015 14:03:26 -0400 MIME-Version: 1.0 In-Reply-To: References: <23d4709cee2fe92c32d41b99c7a3c1823725925a.1436312944.git.luto@kernel.org> <559C8BFE.6050604@linux.intel.com> <20150709090327.GA16677@amd> Date: Thu, 9 Jul 2015 11:03:25 -0700 X-Google-Sender-Auth: Wg_gtpoHjtg0JVkL53Kg8tn1-fo Message-ID: Subject: Re: [PATCH] x86/kconfig/32: Mark CONFIG_VM86 as BROKEN From: Kees Cook To: Andy Lutomirski Cc: Pavel Machek , Thomas Gleixner , Borislav Petkov , Arjan van de Ven , Oleg Nesterov , LKML , X86 ML , Linus Torvalds , Peter Zijlstra , Matthew Garrett Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3142 Lines: 76 On Thu, Jul 9, 2015 at 10:57 AM, Andy Lutomirski wrote: > On Jul 9, 2015 2:03 AM, "Pavel Machek" wrote: >> >> On Wed 2015-07-08 16:00:48, Thomas Gleixner wrote: >> > On Tue, 7 Jul 2015, Arjan van de Ven wrote: >> > >> > > On 7/7/2015 6:25 PM, Andy Lutomirski wrote: >> > > > 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. >> > > > >> > > >> > > while it is never great to deprecate features, in this case I am not sure >> > > there is another choice unless someone steps up to seriously revamp this code. >> > > (and look at it from a PREEMPT, NO_HZ etc etc angle) >> > >> > Aside of being broken in so many aspects it's even more obsolete than >> > 386 support, we should just remove it right away. >> >> Bad news for you: >> >> vbetool-0.5/lrmi.c:#include >> vbetool-0.5/lrmi.c:#include >> vbetool-0.5/lrmi.c:#include >> vbetool-0.5/lrmi.c: struct vm86_struct vm; >> vbetool-0.5/lrmi.c: struct vm86_init_args init; >> ... >> vbetool-0.5/lrmi.c:lrmi_vm86(struct vm86_struct *vm) >> vbetool-0.5/lrmi.c:#define lrmi_vm86 vm86 >> vbetool-0.5/lrmi.c: fputs("vm86() failed\n", stderr); >> vbetool-0.5/lrmi.c:run_vm86(void) >> vbetool-0.5/lrmi.c: vret = lrmi_vm86(&context.vm); >> vbetool-0.5/lrmi.c:vm86_callback(int sig, int code, struct sigcontext >> *sc) >> vbetool-0.5/lrmi.c:vm86_callback(int sig, int code, struct sigcontext >> *sc) >> vbetool-0.5/lrmi.c:run_vm86(void) >> vbetool-0.5/lrmi.c: fprintf(stderr, "run_vm86: callback >> already installed\n"); >> >> vbetool depends on it, and s2ram depends on vbetool. When we get >> proper kernel drivers, this one will be solved, but it is not "more >> obsolete than 386". >> > > vmetool has an x86 emulator. As far as I know, it's been there for a > long time, and I'd be surprised if it doesn't work on CONFIG_VM86=n > kernels. That being said, the code is kind of tangled and it's not > quite clear to me what's going on. > > See: http://www.codon.org.uk/~mjg59/libx86/ > > Perhaps we should instead move CONFIG_VM86 out of EXPERT, default it > to n, and suggest that everyone running a reasonably modern distro > (2006 and up?) turn it off. That seems like a good idea to me. -Kees -- Kees Cook Chrome OS Security -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/