Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752547AbcKIE0H (ORCPT ); Tue, 8 Nov 2016 23:26:07 -0500 Received: from mga07.intel.com ([134.134.136.100]:33644 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751647AbcKIE0E (ORCPT ); Tue, 8 Nov 2016 23:26:04 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,612,1473145200"; d="scan'208";a="189291404" Message-ID: <1478665563.2533.3.camel@ranerica-desktop> Subject: Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention From: Ricardo Neri To: Thomas Gleixner Cc: Andy Lutomirski , Peter Zijlstra , Ingo Molnar , "H. Peter Anvin" , "linux-kernel@vger.kernel.org" , X86 ML , "linux-doc@vger.kernel.org" , Andy Lutomirski , Andrew Morton , Borislav Petkov , Brian Gerst , Chen Yucong , Chris Metcalf , Dave Hansen , Fenghua Yu , Huang Rui , Jiri Slaby , Jonathan Corbet , "Michael S . Tsirkin" , Paul Gortmaker , "Ravi V . Shankar" , Vlastimil Babka , Shuah Khan Date: Tue, 08 Nov 2016 20:26:03 -0800 In-Reply-To: References: <1478585533-19406-1-git-send-email-ricardo.neri-calderon@linux.intel.com> <20161108131600.GF3117@twins.programming.kicks-ass.net> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1179 Lines: 27 On Tue, 2016-11-08 at 17:52 +0100, Thomas Gleixner wrote: > On Tue, 8 Nov 2016, Andy Lutomirski wrote: > > On Tue, Nov 8, 2016 at 5:16 AM, Peter Zijlstra wrote: > > > On Mon, Nov 07, 2016 at 10:12:09PM -0800, Ricardo Neri wrote: > > >> There is a caveat, however. Certain applications running in virtual-8086 > > >> mode, such as DOSEMU[1] and Wine[2], want to utilize the SGDT, SIDT and > > >> SLDT instructions for legitimate reasons. In order to keep such > > >> applications working, UMIP must be disabled/enabled when entering/exiting > > >> virtual-8086 mode. > > > > > > Would it not be better to emulate these instructions for them? What way > > > we can verify they're not malicious. > > > > Forget malice -- if they are really needed for some silly vm86-using > > program, let's trap them and emulate them so they return dummy values. > > handle_vm86_fault() already does instruction emulation, so adding the few > bits there is the right thing to do. Then we just can enable UMIP > unconditionally and be done with it. Ah. I didn't think about that. It make sense to me. I will rework this series with this approach. > > Thanks, > > tglx