Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758814AbdCVHaV (ORCPT ); Wed, 22 Mar 2017 03:30:21 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:33424 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758607AbdCVH36 (ORCPT ); Wed, 22 Mar 2017 03:29:58 -0400 Date: Wed, 22 Mar 2017 08:29:16 +0100 From: Ingo Molnar To: Josh Poimboeuf Cc: Jiri Slaby , mingo@redhat.com, tglx@linutronix.de, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, "Rafael J. Wysocki" , Pavel Machek , linux-pm@vger.kernel.org, Boris Ostrovsky , Juergen Gross , xen-devel@lists.xenproject.org Subject: Re: [PATCH v2 03/10] x86: assembly, use SYM_FUNC_END for functions Message-ID: <20170322072916.GB13904@gmail.com> References: <9ea5e137-61f9-dccc-bb9d-ac3ff86e5867@suse.cz> <20170320123222.15453-1-jslaby@suse.cz> <20170320123222.15453-3-jslaby@suse.cz> <20170321144841.oeaqqarhgzyhehth@treble> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170321144841.oeaqqarhgzyhehth@treble> 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 Content-Length: 1049 Lines: 34 * Josh Poimboeuf wrote: > On Mon, Mar 20, 2017 at 01:32:15PM +0100, Jiri Slaby wrote: > > ENTRY(ftrace_caller) > > /* save_mcount_regs fills in first two parameters */ > > @@ -184,11 +184,12 @@ GLOBAL(ftrace_epilogue) > > GLOBAL(ftrace_graph_call) > > jmp ftrace_stub > > #endif > > +SYM_FUNC_END(ftrace_caller) > > > > /* This is weak to keep gas from relaxing the jumps */ > > WEAK(ftrace_stub) > > retq > > -END(ftrace_caller) > > +SYM_FUNC_END(ftrace_caller) > > This gives ftrace_caller() two ends. Such errors too could be detected automatically via objtool or some other symbol debug mechanism. The reason it might be a good fit for objtool is to make the checking optional (no need to burden a regular build with it), plus objtool already looks at the .o from first principles - a symbol checking sub-functionality could analyze the symbol names in the same pass. If we want to complicate things with CFI then we absolutely should increase the quality of our symbol names space. Thanks, Ingo