From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751273AbeFDUQR (ORCPT ); Mon, 4 Jun 2018 16:16:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:46884 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750998AbeFDUQQ (ORCPT ); Mon, 4 Jun 2018 16:16:16 -0400 Date: Mon, 4 Jun 2018 16:16:12 -0400 From: Steven Rostedt To: Thomas Garnier Cc: kernel-hardening@lists.openwall.com, Ingo Molnar , Thomas Gleixner , "H. Peter Anvin" , x86@kernel.org, Francis Deslauriers , Greg Kroah-Hartman , Andrew Morton , "Peter Zijlstra (Intel)" , Guenter Roeck , nixiaoming , James Hogan , linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 21/27] x86/ftrace: Adapt function tracing for PIE support Message-ID: <20180604161612.6d48d8d2@gandalf.local.home> In-Reply-To: <20180529221625.33541-22-thgarnie@google.com> References: <20180529221625.33541-1-thgarnie@google.com> <20180529221625.33541-22-thgarnie@google.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 29 May 2018 15:15:22 -0700 Thomas Garnier wrote: > When using -fPIE/PIC with function tracing, the compiler generates a > call through the GOT (call *__fentry__@GOTPCREL). This instruction > takes 6 bytes instead of 5 on the usual relative call. > > If PIE is enabled, replace the 6th byte of the GOT call by a 1-byte nop > so ftrace can handle the previous 5-bytes as before. > > Position Independent Executable (PIE) support will allow to extend the > KASLR randomization range 0xffffffff80000000. I thought you were going to write a update to recordmcount.c to handle this at compile time? -- Steve > > Signed-off-by: Thomas Garnier > --- >