Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752836AbdCIWGa (ORCPT ); Thu, 9 Mar 2017 17:06:30 -0500 Received: from smtp29.i.mail.ru ([94.100.177.89]:38186 "EHLO smtp29.i.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752581AbdCIWG2 (ORCPT ); Thu, 9 Mar 2017 17:06:28 -0500 Subject: Re: [v6 PATCH 00/21] x86: Enable User-Mode Instruction Prevention To: Ricardo Neri References: <20170308003254.27833-1-ricardo.neri-calderon@linux.intel.com> <79ba0fff-4c01-2bfa-06cb-5cfc98dd710c@list.ru> <997ba581-ecfa-b773-a48e-85b92a439836@list.ru> <1489021909.131264.30.camel@ranerica-desktop> Cc: Andy Lutomirski , 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 From: Stas Sergeev Message-ID: <62427c4e-7ac3-69a7-a677-4c7f459d541e@list.ru> Date: Fri, 10 Mar 2017 01:05:57 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <1489021909.131264.30.camel@ranerica-desktop> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Authentication-Results: smtp29.i.mail.ru; auth=pass smtp.auth=stsp@list.ru smtp.mailfrom=stsp@list.ru X-7FA49CB5: 0D63561A33F958A515B31869E2E3FDC10D338FAE9A309DD2C022E6B0D69F0D7C9F18ECD7E95F35E929AFE063DF4C541CA5E6244050FC8A2FCA6A32910B188B940BF2EBBBDD9D6B0F700B7D52D678FF46 X-Mailru-Sender: F1845AB6CCC9920DF7838D61D4D05C4220E68340E922374DF38322B0261F91E9212C6783837DC8501653177920737CA72999BEE114A20FF4278B2D54D4112F244F0A872F021F905956A8FB0C6EBA5FCCEAB4BC95F72C04283CDA0F3B3F5B9367 X-Mras: OK Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1639 Lines: 33 09.03.2017 04:11, Ricardo Neri пишет: > On Wed, 2017-03-08 at 19:53 +0300, Stas Sergeev wrote: >> 08.03.2017 19:46, Andy Lutomirski пишет: >>>> 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). >> But then I am confused with the word "compat" in >> your "COMPAT_MASK0_X86_UMIP_FIXUP" and >> "sys_adjust_compat_mask(int op, int word, u32 mask);" >> >> Leaving UMIP on and only disabling a fixup doesn't >> sound like a compat option to me. I would expect >> compat to disable it completely. > I guess that the _UMIP_FIXUP part makes it clear that emulation, not > UMIP is disabled, allowing the SIGSEGV be delivered to the user space > program. > > Would having a COMPAT_MASK0_X86_UMIP_FIXUP to disable emulation and a > COMPAT_MASK0_X86_UMIP to disable UMIP make sense? > > Also, wouldn't having a COMPAT_MASK0_X86_UMIP to disable UMIP defeat its > purpose? Applications could simply use this compat mask to bypass UMIP > and gain access to the instructions it protects. I don't think someone will want to completely disable UMIP, so why do you need such functionality? My question was only what does "compat" mean in "COMPAT_MASK0_X86_UMIP_FIXUP", compat with what.