Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753564AbcKHPeY (ORCPT ); Tue, 8 Nov 2016 10:34:24 -0500 Received: from mail-vk0-f50.google.com ([209.85.213.50]:34393 "EHLO mail-vk0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752194AbcKHPeV (ORCPT ); Tue, 8 Nov 2016 10:34:21 -0500 MIME-Version: 1.0 In-Reply-To: <20161108131600.GF3117@twins.programming.kicks-ass.net> References: <1478585533-19406-1-git-send-email-ricardo.neri-calderon@linux.intel.com> <20161108131600.GF3117@twins.programming.kicks-ass.net> From: Andy Lutomirski Date: Tue, 8 Nov 2016 07:34:00 -0800 Message-ID: Subject: Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention To: Peter Zijlstra Cc: Ricardo Neri , 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 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: 939 Lines: 23 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. 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. --Andy -- Andy Lutomirski AMA Capital Management, LLC