From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754829AbdKATK0 (ORCPT ); Wed, 1 Nov 2017 15:10:26 -0400 Received: from mga04.intel.com ([192.55.52.120]:39344 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751646AbdKATKZ (ORCPT ); Wed, 1 Nov 2017 15:10:25 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,330,1505804400"; d="scan'208";a="1032251709" Date: Wed, 1 Nov 2017 12:08:39 -0700 From: Ricardo Neri To: Borislav Petkov Cc: Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , Andy Lutomirski , Peter Zijlstra , Andrew Morton , Brian Gerst , Chris Metcalf , Dave Hansen , Paolo Bonzini , 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@kernel.org, ricardo.neri@intel.com, Adam Buchbinder , Colin Ian King , Lorenzo Stoakes , Qiaowei Ren , Arnaldo Carvalho de Melo , Adrian Hunter , Kees Cook , Thomas Garnier , Dmitry Vyukov Subject: Re: [PATCH v10 18/18] x86/insn-eval: Incorporate segment base in linear address computation Message-ID: <20171101190839.GA23180@voyager> References: <1509135945-13762-1-git-send-email-ricardo.neri-calderon@linux.intel.com> <1509135945-13762-19-git-send-email-ricardo.neri-calderon@linux.intel.com> <20171101175642.ep7ijnvzi6o37u5w@pd.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171101175642.ep7ijnvzi6o37u5w@pd.tnic> 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 Wed, Nov 01, 2017 at 06:56:42PM +0100, Borislav Petkov wrote: > On Fri, Oct 27, 2017 at 01:25:45PM -0700, Ricardo Neri wrote: > > insn_get_addr_ref() returns the effective address as defined by the > > section 3.7.5.1 Vol 1 of the Intel 64 and IA-32 Architectures Software > > Developer's Manual. In order to compute the linear address, we must add > > to the effective address the segment base address as set in the segment > > descriptor. The segment descriptor to use depends on the register used as > > operand and segment override prefixes, if any. > > > > In most cases, the segment base address will be 0 if the USER_DS/USER32_DS > > segment is used or if segmentation is not used. However, the base address > > is not necessarily zero if a user programs defines its own segments. This > > is possible by using a local descriptor table. > > > > Since the effective address is a signed quantity, the unsigned segment > > base address is saved in a separate variable and added to the final, > > unsigned, effective address. > > > > Cc: Dave Hansen > > Cc: Adam Buchbinder > > Cc: Colin Ian King > > Cc: Lorenzo Stoakes > > Cc: Qiaowei Ren > > Cc: Arnaldo Carvalho de Melo > > Cc: Masami Hiramatsu > > Cc: Adrian Hunter > > Cc: Kees Cook > > Cc: Thomas Garnier > > Cc: Peter Zijlstra > > Cc: Borislav Petkov > > Cc: Dmitry Vyukov > > Cc: Ravi V. Shankar > > Cc: x86@kernel.org > > Signed-off-by: Ricardo Neri > > --- > > arch/x86/lib/insn-eval.c | 55 +++++++++++++++++++++++++++++++++++++++++++++--- > > 1 file changed, 52 insertions(+), 3 deletions(-) > > Reviewed-by: Borislav Petkov Thank you Borislav! This should complete tne review of this series. As proposed earier [1], I guess that, if the tip maintainers are OK, this series can be merged in the tip tree? BR, Ricardo [1]. https://lkml.org/lkml/2017/10/20/851