Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752784AbcKIEbd (ORCPT ); Tue, 8 Nov 2016 23:31:33 -0500 Received: from mga05.intel.com ([192.55.52.43]:52544 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751244AbcKIEbb (ORCPT ); Tue, 8 Nov 2016 23:31:31 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,612,1473145200"; d="scan'208";a="899341999" Message-ID: <1478665889.2533.8.camel@ranerica-desktop> Subject: Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention From: Ricardo Neri To: Andy Lutomirski Cc: Peter Zijlstra , Ingo Molnar , Thomas Gleixner , "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:31:29 -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: 915 Lines: 23 On Tue, 2016-11-08 at 07:34 -0800, Andy Lutomirski wrote: > > 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. > > Also, keep in mind that vm86 is already effectively gated behind a > sysctl for non-root. I think the default should be that, if root has > enabled vm86, it should work. Then should I keep UMIP enabled by default and still provide an option to disable it via a kernel parameter? Also, a third option, umip=novm86 would "disable" UMIP in vm86 tasks. Under the new approach (of emulating the impacted instructions), this option, a #GP fault would still be generated but the actual values of GDT/LDT/IDT/MSW would be passed to user space. Does this make sense? Thanks and BR, Ricardo