From: Peter Zijlstra Subject: Re: [PATCH v2 21/27] x86/ftrace: Adapt function tracing for PIE support Date: Wed, 14 Mar 2018 11:35:37 +0100 Message-ID: <20180314103537.GR4043@hirez.programming.kicks-ass.net> References: <20180313205945.245105-1-thgarnie@google.com> <20180313205945.245105-22-thgarnie@google.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Kate Stewart , Nicolas Pitre , Michal Hocko , Sergey Senozhatsky , Petr Mladek , Len Brown , Boris Ostrovsky , Christopher Li , Dave Hansen , x86@kernel.org, Dominik Brodowski , linux-kernel@vger.kernel.org, Masahiro Yamada , Pavel Machek , "H . Peter Anvin" , kernel-hardening@lists.openwall.com, Christoph Lameter , Jiri Slaby , Alok Kataria , linux-doc@vger.kernel.org, linux-arch@vger.kernel.org, Herbert Xu , Baoquan He , Jonathan Corbet , Joerg Roede To: Thomas Garnier Return-path: Content-Disposition: inline In-Reply-To: <20180313205945.245105-22-thgarnie@google.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: virtualization-bounces@lists.linux-foundation.org Errors-To: virtualization-bounces@lists.linux-foundation.org List-Id: linux-crypto.vger.kernel.org On Tue, Mar 13, 2018 at 01:59:39PM -0700, Thomas Garnier wrote: > + /* > + * If PIE is not enabled or no GOT call was found, default to the > + * original approach to code modification. > + */ > + if (!IS_ENABLED(CONFIG_X86_PIE) > + || probe_kernel_read(replaced, (void *)ip, sizeof(replaced)) > + || memcmp(replaced, got_call_preinsn, sizeof(got_call_preinsn))) > + return ftrace_modify_code_direct(ip, old_code, new_code); The predominant kernel style is to place the operators at the end of the previous line, not first on the new line.