From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932516AbdJ0VsK (ORCPT ); Fri, 27 Oct 2017 17:48:10 -0400 Received: from mga09.intel.com ([134.134.136.24]:36833 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932190AbdJ0VsJ (ORCPT ); Fri, 27 Oct 2017 17:48:09 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,305,1505804400"; d="scan'208";a="143154326" Date: Fri, 27 Oct 2017 14:46:58 -0700 From: Ricardo Neri To: Andy Lutomirski Cc: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , 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 , "Ravi V. Shankar" , Shuah Khan , "linux-kernel@vger.kernel.org" , X86 ML , "Neri, Ricardo" , Fenghua Yu , Tony Luck Subject: Re: [PATCH v9 25/29] x86/umip: Force a page fault when unable to copy emulated result to user Message-ID: <20171027214658.GA14203@voyager> References: <1507089272-32733-1-git-send-email-ricardo.neri-calderon@linux.intel.com> <1507089272-32733-26-git-send-email-ricardo.neri-calderon@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 26, 2017 at 12:59:55AM -0700, Andy Lutomirski wrote: > On Tue, Oct 3, 2017 at 8:54 PM, Ricardo Neri > wrote: > > fixup_umip_exception() will be called from do_general_protection(). If the > > former returns false, the latter will issue a SIGSEGV with SEND_SIG_PRIV. > > However, when emulation is successful but the emulated result cannot be > > copied to user space memory, it is more accurate to issue a SIGSEGV with > > SEGV_MAPERR with the offending address. A new function, inspired in > > force_sig_info_fault(), is introduced to model the page fault. > > This code is slightly buggy (with, for example, PKRU, although the > chance that anyone ever notices is about nil). For an alternative > approach, see current->thread.sig_on_uaccess_err, used in > arch/x86/entry/vsyscall/vsyscall_64.c. But I'm fine with this patch > as is, too. Thanks Andy, I will study the alternative you mention. Since you are OK with this patch, I will submit v10 of this series to allow the review of the series to continue. BR, Ricardo