projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
45c815f
)
perf: Fix orphan hole
author
Peter Zijlstra
<
[email protected]
>
Mon, 25 Jan 2016 13:08:45 +0000
(14:08 +0100)
committer
Ingo Molnar
<
[email protected]
>
Thu, 28 Jan 2016 19:06:35 +0000
(20:06 +0100)
We should set event->owner before we install the event,
otherwise there is a hole where the target task can fork() and
we'll not inherit the event because it thinks the event is
orphaned.
Signed-off-by: Peter Zijlstra <
[email protected]
>
Cc: Arnaldo Carvalho de Melo <
[email protected]
>
Cc: Jiri Olsa <
[email protected]
>
Cc: Linus Torvalds <
[email protected]
>
Cc: Thomas Gleixner <
[email protected]
>
Cc:
[email protected]
Signed-off-by: Ingo Molnar <
[email protected]
>
kernel/events/core.c
patch
|
blob
|
history
diff --git
a/kernel/events/core.c
b/kernel/events/core.c
index 9de4d352ba8cdc3a7ba222929f76715114baa709..6759f2a332d76f1fe513fec3946e441e754a94f9 100644
(file)
--- a/
kernel/events/core.c
+++ b/
kernel/events/core.c
@@
-8489,6
+8489,8
@@
SYSCALL_DEFINE5(perf_event_open,
perf_event__header_size(event);
perf_event__id_header_size(event);
+ event->owner = current;
+
perf_install_in_context(ctx, event, event->cpu);
perf_unpin_context(ctx);
@@
-8498,8
+8500,6
@@
SYSCALL_DEFINE5(perf_event_open,
put_online_cpus();
- event->owner = current;
-
mutex_lock(¤t->perf_event_mutex);
list_add_tail(&event->owner_entry, ¤t->perf_event_list);
mutex_unlock(¤t->perf_event_mutex);