Skip to content

Commit ee9b63d

Browse files
committed
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
2 parents 0fa7271 + d525211 commit ee9b63d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

kernel/events/core.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4574,6 +4574,13 @@ static void perf_pending_event(struct irq_work *entry)
45744574
{
45754575
struct perf_event *event = container_of(entry,
45764576
struct perf_event, pending);
4577+
int rctx;
4578+
4579+
rctx = perf_swevent_get_recursion_context();
4580+
/*
4581+
* If we 'fail' here, that's OK, it means recursion is already disabled
4582+
* and we won't recurse 'further'.
4583+
*/
45774584

45784585
if (event->pending_disable) {
45794586
event->pending_disable = 0;
@@ -4584,6 +4591,9 @@ static void perf_pending_event(struct irq_work *entry)
45844591
event->pending_wakeup = 0;
45854592
perf_event_wakeup(event);
45864593
}
4594+
4595+
if (rctx >= 0)
4596+
perf_swevent_put_recursion_context(rctx);
45874597
}
45884598

45894599
/*

0 commit comments

Comments
 (0)