public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Jiri Olsa <jolsa@redhat.com>
Cc: Mathias Krause <minipli@googlemail.com>,
	Peter Zijlstra <a.p.zijlstra@chello.nl>,
	Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] perf x86: Fix perf to use non-executable stack, again
Date: Sun, 27 Apr 2014 13:49:24 +0200	[thread overview]
Message-ID: <20140427114924.GB21935@gmail.com> (raw)
In-Reply-To: <20140427103915.GC1111@krava.brq.redhat.com>


* Jiri Olsa <jolsa@redhat.com> wrote:

> On Sun, Apr 27, 2014 at 12:03:50PM +0200, Mathias Krause wrote:
> 
> SNIP
> 
> > >> 1.7.10.4
> > >>
> > >
> > > hum, how about fixing this once and for all.. ;-)
> > > please check attached patch, thanks
> > 
> > Yeah, I thought about this option too but declined it for two reasons:
> > 1/ The kernel sources should provide good quality examples, even for
> > usage outside of the kernel. Imagine somebody taking the memcpy
> > implementation for his own project but not copying the LDFLAGS. That
> > would make his code have an executable stack while with the .GNU-stack
> > marker in the assembler file it won't.
> 
> that 'somebody' should check/know better ;-) but ok, fair enough
> 
> > 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?
> 
> anyway I have no objection for leaving that code in assembly
> objects, but I suggest we use the global option as well to
> prevent any future surprise..

Correct. Regression in this area is 'silent' and can go unnoticed for 
long, because it has no functional side effects. So being defensive 
and forcing the secure option we want is important.

That way if an executable stack is needed by a patch then perf will 
break visibly, and the patch that relies on an executable stack can be 
fixed ...

So for the combo solution:

Acked-by: Ingo Molnar <mingo@kernel.org>

Thanks,

	Ingo

  reply	other threads:[~2014-04-27 11:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-26 19:02 [PATCH] perf x86: Fix perf to use non-executable stack, again Mathias Krause
2014-04-27  9:26 ` Jiri Olsa
2014-04-27 10:03   ` Mathias Krause
2014-04-27 10:39     ` Jiri Olsa
2014-04-27 11:49       ` Ingo Molnar [this message]
2014-04-27 16:07       ` Mathias Krause
2014-04-27 16:16         ` Jiri Olsa
2014-04-27 16:29           ` Mathias Krause
2014-05-07 16:34             ` Ingo Molnar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140427114924.GB21935@gmail.com \
    --to=mingo@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=minipli@googlemail.com \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox