android_kernel_motorola_sm6375/kernel/events
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Peter Zijlstra 79c9ce57eb perf/core: Fix perf_event_open() vs. execve() race
Jann reported that the ptrace_may_access() check in
find_lively_task_by_vpid() is racy against exec().

Specifically:

  perf_event_open()		execve()

  ptrace_may_access()
				commit_creds()
  ...				if (get_dumpable() != SUID_DUMP_USER)
				  perf_event_exit_task();
  perf_install_in_context()

would result in installing a counter across the creds boundary.

Fix this by wrapping lots of perf_event_open() in cred_guard_mutex.
This should be fine as perf_event_exit_task() is already called with
cred_guard_mutex held, so all perf locks already nest inside it.

Reported-by: Jann Horn <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Cc: Vince Weaver <[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
2016-04-28 10:32:41 +02:00
..
callchain.c perf: generalize perf_callchain 2016-02-20 00:21:44 -05:00
core.c perf/core: Fix perf_event_open() vs. execve() race 2016-04-28 10:32:41 +02:00
hw_breakpoint.c perf: Collapse and fix event_function_call() users 2016-01-21 18:54:24 +01:00
internal.h perf: generalize perf_callchain 2016-02-20 00:21:44 -05:00
Makefile ftrace: allow architectures to specify ftrace compile options 2015-01-29 09:19:19 +01:00
ring_buffer.c perf/core: Fix Undefined behaviour in rb_alloc() 2016-03-21 09:08:18 +01:00
uprobes.c mm, fs: get rid of PAGE_CACHE_* and page_cache_{get,release} macros 2016-04-04 10:41:08 -07:00