All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Dave Jones <davej@redhat.com>,
	paulmck@linux.vnet.ibm.com,
	Linux Kernel <linux-kernel@vger.kernel.org>,
	Ingo Molnar <mingo@kernel.org>, Jiri Olsa <jolsa@redhat.com>
Subject: Re: suspicious RCU usage (perf)
Date: Fri, 30 Aug 2013 17:59:36 +0200	[thread overview]
Message-ID: <20130830155936.GT31370@twins.programming.kicks-ass.net> (raw)
In-Reply-To: <20130830155242.GB10875@somewhere>

On Fri, Aug 30, 2013 at 05:52:43PM +0200, Frederic Weisbecker wrote:
> On Tue, Aug 27, 2013 at 02:16:29PM +0200, Peter Zijlstra wrote:
> > On Mon, Aug 26, 2013 at 03:03:04PM -0400, Steven Rostedt wrote:
> > > > Is there some path through sys_perf_open_event that might be
> > > > missing a capability check perhaps ?
> > > > 
> > > 
> > > That's a question for Ingo, Peter or Jiri.
> > 
> > Its not something I've looked at recently, git blames Jiri and fweisbec
> > for most of that code.
> > 
> > Permission checks appear to live in
> > kernel/trace/trace_event_perf.c:perf_trace_event_perm().
> 
> Actually the following condition is weird:
> 
> 	 /* The ftrace function trace is allowed only for root. */
> 	 if (ftrace_event_is_function(tp_event) &&
> 	     perf_paranoid_kernel() && !capable(CAP_SYS_ADMIN))
>      			    return -EPERM;
> 

That says: If its its a function-event and we're paranoid but we don't
have root, bail.

> We probably intended to do:
> 
>    /* The ftrace function trace is allowed only for root. */
>    if (ftrace_event_is_function(tp_event) ||
>        perf_paranoid_kernel() && !capable(CAP_SYS_ADMIN))
>        			      return -EPERM;
> 
> Can somebody confirm?

That would always disallow function-events, no?

  reply	other threads:[~2013-08-30 15:59 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-26 14:58 suspicious RCU usage (perf) Dave Jones
2013-08-26 16:29 ` Paul E. McKenney
2013-08-26 17:30   ` Steven Rostedt
2013-08-26 17:50     ` Dave Jones
2013-08-26 18:18       ` Steven Rostedt
2013-08-26 18:29         ` Dave Jones
2013-08-26 19:03           ` Steven Rostedt
2013-08-27 12:16             ` Peter Zijlstra
2013-08-30 15:49               ` Frederic Weisbecker
2013-08-30 15:52               ` Frederic Weisbecker
2013-08-30 15:59                 ` Peter Zijlstra [this message]
2013-08-30 16:06                   ` Frederic Weisbecker
2013-08-26 19:43           ` David Ahern
2013-08-26 19:49             ` Dave Jones
2013-08-27 13:10               ` Steven Rostedt
2013-08-27 13:58                 ` David Ahern
2013-08-27 14:13                   ` Dave Jones

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=20130830155936.GT31370@twins.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=davej@redhat.com \
    --cc=fweisbec@gmail.com \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=rostedt@goodmis.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.