public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] perf: Fix tracepoint events permissions check
@ 2014-07-11 11:56 Jiri Olsa
  2014-07-11 11:56 ` [PATCH 1/5] perf: Make perf_init_event function static Jiri Olsa
                   ` (6 more replies)
  0 siblings, 7 replies; 21+ messages in thread
From: Jiri Olsa @ 2014-07-11 11:56 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Yarygin, Arnaldo Carvalho de Melo, Corey Ashford,
	Frederic Weisbecker, Ingo Molnar, Paul Mackerras, Peter Zijlstra

hi,
sending fix for bug reported by Alexander Yarygin in here:
  http://marc.info/?l=linux-kernel&m=140475133707722&w=2

The main problem was, that the event_init tracepoint callback
checked permission of the 'current' task instead of the event
owner task.

While this is ok for perf_event_open syscall check, it is wrong
once event_init is called during fork to create child events.
In this case the permission of the forked task is checked instead
of the owner task of the parent event.

Changing tracepoint permission code to check event's owner task,
plus some other changes I needed for this.

thanks,
jirka


---
Jiri Olsa (5):
      perf: Make perf_init_event function static
      perf: Destroy event's children on task exit
      perf: Initialize owner before calling event_init callback
      perf: Move event owner retrieval into perf_event_get_owner
      perf: Check event's owner permission in tracepoint init callback

 include/linux/perf_event.h      |  1 +
 kernel/events/core.c            | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-----------------
 kernel/trace/trace_event_perf.c | 19 +++++++++++++++++--
 3 files changed, 73 insertions(+), 19 deletions(-)

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2014-07-28  8:29 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-11 11:56 [PATCH 0/5] perf: Fix tracepoint events permissions check Jiri Olsa
2014-07-11 11:56 ` [PATCH 1/5] perf: Make perf_init_event function static Jiri Olsa
2014-07-11 11:56 ` [PATCH 2/5] perf: Destroy event's children on task exit Jiri Olsa
2014-07-11 13:23   ` Peter Zijlstra
2014-07-11 13:31     ` Jiri Olsa
2014-07-16 12:20     ` Ingo Molnar
2014-07-14 11:18   ` Peter Zijlstra
2014-07-14 11:43     ` Jiri Olsa
2014-07-14 13:02       ` Peter Zijlstra
2014-07-14 13:22         ` Jiri Olsa
2014-07-14 13:35           ` Peter Zijlstra
2014-07-14 14:21             ` Jiri Olsa
2014-07-16 12:14             ` Jiri Olsa
2014-07-14 20:18     ` Jiri Olsa
2014-07-15  9:11       ` Peter Zijlstra
2014-07-15  9:31         ` Jiri Olsa
2014-07-11 11:56 ` [PATCH 3/5] perf: Initialize owner before calling event_init callback Jiri Olsa
2014-07-11 11:56 ` [PATCH 4/5] perf: Move event owner retrieval into perf_event_get_owner Jiri Olsa
2014-07-11 11:56 ` [PATCH 5/5] perf: Check event's owner permission in tracepoint init callback Jiri Olsa
2014-07-11 12:02 ` [PATCH 0/5] perf: Fix tracepoint events permissions check Jiri Olsa
2014-07-28  8:28 ` [tip:perf/core] perf: Check permission only for parent tracepoint event tip-bot for Jiri Olsa

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox