Skip to content

Commit 80102f2

Browse files
committed
Merge tag 'perf_urgent_for_v6.3_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull perf fixes from Borislav Petkov: - Check whether sibling events have been deactivated before adding them to groups - Update the proper event time tracking variable depending on the event type - Fix a memory overwrite issue due to using the wrong function argument when outputting perf events * tag 'perf_urgent_for_v6.3_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: perf: Fix check before add_event_to_groups() in perf_group_detach() perf: fix perf_event_context->time perf/core: Fix perf_output_begin parameter is incorrectly invoked in perf_event_bpf_output
2 parents 4ac39c5 + fd0815f commit 80102f2

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

kernel/events/core.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2163,7 +2163,7 @@ static void perf_group_detach(struct perf_event *event)
21632163
/* Inherit group flags from the previous leader */
21642164
sibling->group_caps = event->group_caps;
21652165

2166-
if (!RB_EMPTY_NODE(&event->group_node)) {
2166+
if (sibling->attach_state & PERF_ATTACH_CONTEXT) {
21672167
add_event_to_groups(sibling, event->ctx);
21682168

21692169
if (sibling->state == PERF_EVENT_STATE_ACTIVE)
@@ -3872,7 +3872,7 @@ ctx_sched_in(struct perf_event_context *ctx, enum event_type_t event_type)
38723872
if (likely(!ctx->nr_events))
38733873
return;
38743874

3875-
if (is_active ^ EVENT_TIME) {
3875+
if (!(is_active & EVENT_TIME)) {
38763876
/* start ctx time */
38773877
__update_context_time(ctx, false);
38783878
perf_cgroup_set_timestamp(cpuctx);
@@ -9187,7 +9187,7 @@ static void perf_event_bpf_output(struct perf_event *event, void *data)
91879187

91889188
perf_event_header__init_id(&bpf_event->event_id.header,
91899189
&sample, event);
9190-
ret = perf_output_begin(&handle, data, event,
9190+
ret = perf_output_begin(&handle, &sample, event,
91919191
bpf_event->event_id.header.size);
91929192
if (ret)
91939193
return;

0 commit comments

Comments
 (0)