From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752720AbdCHRPV (ORCPT ); Wed, 8 Mar 2017 12:15:21 -0500 Received: from mail-ua0-f180.google.com ([209.85.217.180]:36483 "EHLO mail-ua0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750778AbdCHRPS (ORCPT ); Wed, 8 Mar 2017 12:15:18 -0500 MIME-Version: 1.0 In-Reply-To: <997ba581-ecfa-b773-a48e-85b92a439836@list.ru> References: <20170308003254.27833-1-ricardo.neri-calderon@linux.intel.com> <79ba0fff-4c01-2bfa-06cb-5cfc98dd710c@list.ru> <997ba581-ecfa-b773-a48e-85b92a439836@list.ru> From: Andy Lutomirski Date: Wed, 8 Mar 2017 08:46:20 -0800 Message-ID: Subject: Re: [v6 PATCH 00/21] x86: Enable User-Mode Instruction Prevention To: Stas Sergeev Cc: Ricardo Neri , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andy Lutomirski , Borislav Petkov , Peter Zijlstra , Andrew Morton , Brian Gerst , Chris Metcalf , Dave Hansen , Paolo Bonzini , Liang Z Li , Masami Hiramatsu , Huang Rui , Jiri Slaby , Jonathan Corbet , "Michael S. Tsirkin" , Paul Gortmaker , Vlastimil Babka , Chen Yucong , Alexandre Julliard , Fenghua Yu , "Ravi V. Shankar" , Shuah Khan , "linux-kernel@vger.kernel.org" , X86 ML , linux-msdos@vger.kernel.org, wine-devel@winehq.org 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-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by mail.home.local id v28HFU3g004851 On Wed, Mar 8, 2017 at 8:29 AM, Stas Sergeev wrote: > 08.03.2017 19:06, Andy Lutomirski пишет: >> >> On Wed, Mar 8, 2017 at 6:08 AM, Stas Sergeev wrote: >>> >>> 08.03.2017 03:32, Ricardo Neri пишет: >>>> >>>> These are the instructions covered by UMIP: >>>> * SGDT - Store Global Descriptor Table >>>> * SIDT - Store Interrupt Descriptor Table >>>> * SLDT - Store Local Descriptor Table >>>> * SMSW - Store Machine Status Word >>>> * STR - Store Task Register >>>> >>>> This patchset initially treated tasks running in virtual-8086 mode as a >>>> special case. However, I received clarification that DOSEMU[8] does not >>>> support applications that use these instructions. >> >> Can you remind me what was special about it? It looks like you still >> emulate them in v8086 mode. > > Indeed, sorry, I meant prot mode here. :) > So I wonder what was cited to be special about v86. Not sure. Ricardo? > >>> Yes, this is the case. >>> But at least in the past there was an attempt to >>> support SLDT as it is used by an ancient pharlap >>> DOS extender (currently unsupported by dosemu1/2). >>> So how difficult would it be to add an optional >>> possibility of delivering such SIGSEGV to userspace >>> so that the kernel's dummy emulation can be overridden? >>> It doesn't need to be a matter of this particular >>> patch set, i.e. this proposal should not trigger a >>> v7 resend of all 21 patches. :) But it would be useful >>> for the future development of dosemu2. >> >> What I'd actually like to see is a totally separate patchset that adds >> an inheritable (but reset on exec) per-task mask of legacy >> compatibility features to disable. Maybe: >> >> sys_adjust_compat_mask(int op, int word, u32 mask); > > No no, since I meant prot mode, this is not what I need. > I would never need to disable UMIP as to allow the > prot mode apps to do SLDT. Instead it would be good > to have an ability to provide a replacement for the dummy > emulation that is currently being proposed for kernel. > All is needed for this, is just to deliver a SIGSEGV. That's what I meant. Turning off FIXUP_UMIP would leave UMIP on but turn off the fixup, so you'd get a SIGSEGV indicating #GP (or a vm86 GP exit). --Andy From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Lutomirski Subject: Re: [v6 PATCH 00/21] x86: Enable User-Mode Instruction Prevention Date: Wed, 8 Mar 2017 08:46:20 -0800 Message-ID: References: <20170308003254.27833-1-ricardo.neri-calderon@linux.intel.com> <79ba0fff-4c01-2bfa-06cb-5cfc98dd710c@list.ru> <997ba581-ecfa-b773-a48e-85b92a439836@list.ru> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amacapital-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=j/eWK5ZhWQnJInxb8focZfepw0yPTaBAfjmG6wKhSwE=; b=tT3rMLWmmJDPKgKHliGU72Qysce/YDAMQDaLB+bYQjGXTchAlGCDd++KJI9+mC7XGs WwXPtTvQlixNPoaR4uNLgpB51cynv/v0UR3pT578fIl2HjO93FgF+ADhkRrxLvp0yqwA ukaM2SsQHrYRDwa/cGkZviBaroEOg3QrcrPlVdZMlpMdt83n/Zy06RM53Xnb73t4Wa8v qpm564PiAtialOj5zgak9XJVfAi16NfeDeO19FJpJrjjQ3Z4tmrXyq0VecVXhcL8uu8A T8wX/79YWLqEDKhh04936GR3/J9gFoPDDWfN2HAIuJgUHx3xlYWDy5AX2CmXsNVNFXNJ kNqg== In-Reply-To: <997ba581-ecfa-b773-a48e-85b92a439836@list.ru> Sender: linux-kernel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="utf-8" To: Stas Sergeev Cc: Ricardo Neri , Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andy Lutomirski , Borislav Petkov , Peter Zijlstra , Andrew Morton , Brian Gerst , Chris Metcalf , Dave Hansen , Paolo Bonzini , Liang Z Li , Masami Hiramatsu , Huang Rui , Jiri Slaby , Jonathan Corbet , "Michael S. Tsirkin" , Paul Gortmaker , Vlastimil Babka On Wed, Mar 8, 2017 at 8:29 AM, Stas Sergeev wrote: > 08.03.2017 19:06, Andy Lutomirski =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >> >> On Wed, Mar 8, 2017 at 6:08 AM, Stas Sergeev wrote: >>> >>> 08.03.2017 03:32, Ricardo Neri =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>>> >>>> These are the instructions covered by UMIP: >>>> * SGDT - Store Global Descriptor Table >>>> * SIDT - Store Interrupt Descriptor Table >>>> * SLDT - Store Local Descriptor Table >>>> * SMSW - Store Machine Status Word >>>> * STR - Store Task Register >>>> >>>> This patchset initially treated tasks running in virtual-8086 mode as = a >>>> special case. However, I received clarification that DOSEMU[8] does no= t >>>> support applications that use these instructions. >> >> Can you remind me what was special about it? It looks like you still >> emulate them in v8086 mode. > > Indeed, sorry, I meant prot mode here. :) > So I wonder what was cited to be special about v86. Not sure. Ricardo? > >>> Yes, this is the case. >>> But at least in the past there was an attempt to >>> support SLDT as it is used by an ancient pharlap >>> DOS extender (currently unsupported by dosemu1/2). >>> So how difficult would it be to add an optional >>> possibility of delivering such SIGSEGV to userspace >>> so that the kernel's dummy emulation can be overridden? >>> It doesn't need to be a matter of this particular >>> patch set, i.e. this proposal should not trigger a >>> v7 resend of all 21 patches. :) But it would be useful >>> for the future development of dosemu2. >> >> What I'd actually like to see is a totally separate patchset that adds >> an inheritable (but reset on exec) per-task mask of legacy >> compatibility features to disable. Maybe: >> >> sys_adjust_compat_mask(int op, int word, u32 mask); > > No no, since I meant prot mode, this is not what I need. > I would never need to disable UMIP as to allow the > prot mode apps to do SLDT. Instead it would be good > to have an ability to provide a replacement for the dummy > emulation that is currently being proposed for kernel. > All is needed for this, is just to deliver a SIGSEGV. That's what I meant. Turning off FIXUP_UMIP would leave UMIP on but turn off the fixup, so you'd get a SIGSEGV indicating #GP (or a vm86 GP exit). --Andy