diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-03-28 11:12:08 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-03-28 11:12:08 -0700 |
commit | ee9b63dd0fed60565829b489d29f80927a6fcf3d (patch) | |
tree | 6e7bf7417151024bc6c21e235ce6fbe81a84babd | |
parent | 0fa7271a8a4e957c82b32ee4c81ff22709567d1b (diff) | |
parent | d525211f9d1be8b523ec7633f080f2116f5ea536 (diff) | |
download | op-kernel-dev-ee9b63dd0fed60565829b489d29f80927a6fcf3d.zip op-kernel-dev-ee9b63dd0fed60565829b489d29f80927a6fcf3d.tar.gz |
Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fix from Ingo Molnar:
"A perf kernel side fix for a fuzzer triggered lockup"
* 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
perf: Fix irq_work 'tail' recursion
-rw-r--r-- | kernel/events/core.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/kernel/events/core.c b/kernel/events/core.c index 453ef61..2fabc06 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -4574,6 +4574,13 @@ static void perf_pending_event(struct irq_work *entry) { struct perf_event *event = container_of(entry, struct perf_event, pending); + int rctx; + + rctx = perf_swevent_get_recursion_context(); + /* + * If we 'fail' here, that's OK, it means recursion is already disabled + * and we won't recurse 'further'. + */ if (event->pending_disable) { event->pending_disable = 0; @@ -4584,6 +4591,9 @@ static void perf_pending_event(struct irq_work *entry) event->pending_wakeup = 0; perf_event_wakeup(event); } + + if (rctx >= 0) + perf_swevent_put_recursion_context(rctx); } /* |