diff --git a/kernel/events/core.c b/kernel/events/core.c index 3f0cb82e4fbcc562e76d2d5d2df649860c07b304..f953dd16a5e2bbcb2a277fb703b764c4be92af15 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -11862,6 +11862,10 @@ static int inherit_group(struct perf_event *parent_event, child, leader, child_ctx); if (IS_ERR(child_ctr)) return PTR_ERR(child_ctr); + + if (sub->aux_event == parent_event && + !perf_get_aux_event(child_ctr, leader)) + return -EINVAL; } return 0; }