From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755659AbaEGQev (ORCPT ); Wed, 7 May 2014 12:34:51 -0400 Received: from mail-ee0-f49.google.com ([74.125.83.49]:42180 "EHLO mail-ee0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752254AbaEGQet (ORCPT ); Wed, 7 May 2014 12:34:49 -0400 Date: Wed, 7 May 2014 18:34:43 +0200 From: Ingo Molnar To: Mathias Krause Cc: Jiri Olsa , Peter Zijlstra , Paul Mackerras , Ingo Molnar , Arnaldo Carvalho de Melo , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] perf x86: Fix perf to use non-executable stack, again Message-ID: <20140507163443.GA16034@gmail.com> References: <1398538965-10620-1-git-send-email-minipli@googlemail.com> <20140427092649.GA1111@krava.brq.redhat.com> <20140427103915.GC1111@krava.brq.redhat.com> <20140427161632.GA27784@krava.brq.redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Mathias Krause wrote: > On 27 April 2014 18:16, Jiri Olsa wrote: > > On Sun, Apr 27, 2014 at 06:07:30PM +0200, Mathias Krause wrote: > >> On 27 April 2014 12:39, Jiri Olsa wrote: > >> > On Sun, Apr 27, 2014 at 12:03:50PM +0200, Mathias Krause wrote: > >> > [...] > >> >> 2/ What if somebody tries to add/link code to perf that makes use of > >> >> nested functions? That'll make perf fail as the trampoline code > >> >> generated by gcc won't be executable due to the enforced > >> >> non-executable stack by -Wl,-z,noexecstack. > >> > > >> > I guess in that case he would change the Makefile as well? > >> > >> Not necessarily. What if a later version of a library already used by > >> perf needs an executable stack because it now makes use of nested > >> functions? Unlikely, though in that case no change to perf would be > >> made, but perf would then require an executable stack, too. > > > > I tried you can run binary with noexecstack having dynamic > > library dependency wit execstack > > Well, it might work on your system but it won't work on mine. See this > bug, why: https://sourceware.org/bugzilla/show_bug.cgi?id=12492 > > > [...] > >> > >> > or insert test case for perf's executable stack to 'perf test' > >> > >> That won't work for systems preventing processes getting an executable > >> stack in the first place. That was the reason I stumbled about the > > > > could be disabled on such systems > > Of course, it could be disabled, i.e. I could allow perf to get an > executable stack. Though, I don't like my stacks to be executable ;) Absolutely. Using an executable stack is really just a legacy thing, it should be avoided (and I'd say it must be avoided) in any modern application. Thanks, Ingo