Message ID | 1493832958-12489-4-git-send-email-amit.pundir@linaro.org |
---|---|
State | New |
Headers | show |
Series | Security fixes picked from android security bulletins | expand |
On Wed, May 3, 2017 at 10:35 AM, Amit Pundir <amit.pundir@linaro.org> wrote: > > Signed-off-by: Ingo Molnar <mingo@kernel.org> > (cherry picked from commit c3c87e770458aa004bd7ed3f29945ff436fd6511) > Signed-off-by: Amit Pundir <amit.pundir@linaro.org> When sending things to the stable tree, it's better to make that upstream information explicit at the top, rather than hiding it like this in the sign-off change. IOW, just somethuing like "commit c3c87e770458aa004bd7ed3f29945ff436fd6511 upstream" as the first line of the body (not the subject line) tends to be the standard way. I suspect Greg edits things that way anyway, but it presumably helps if it's already in the right format. That way i*really* stands out what commit that is upstream. Linus
On 3 May 2017 at 23:12, Linus Torvalds <torvalds@linux-foundation.org> wrote: > On Wed, May 3, 2017 at 10:35 AM, Amit Pundir <amit.pundir@linaro.org> wrote: >> >> Signed-off-by: Ingo Molnar <mingo@kernel.org> >> (cherry picked from commit c3c87e770458aa004bd7ed3f29945ff436fd6511) >> Signed-off-by: Amit Pundir <amit.pundir@linaro.org> > > When sending things to the stable tree, it's better to make that > upstream information explicit at the top, rather than hiding it like > this in the sign-off change. > > IOW, just somethuing like > > "commit c3c87e770458aa004bd7ed3f29945ff436fd6511 upstream" > > as the first line of the body (not the subject line) tends to be the > standard way. > > I suspect Greg edits things that way anyway, but it presumably helps > if it's already in the right format. > > That way i*really* stands out what commit that is upstream. Thanks. I'll take care of the format from next time. Regards, Amit Pundir > > Linus
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index df8904fea40c..482ccff29bc9 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -455,11 +455,6 @@ struct perf_event { #endif /* CONFIG_PERF_EVENTS */ }; -enum perf_event_context_type { - task_context, - cpu_context, -}; - /** * struct perf_event_context - event context structure * @@ -467,7 +462,6 @@ enum perf_event_context_type { */ struct perf_event_context { struct pmu *pmu; - enum perf_event_context_type type; /* * Protect the states of the events in the list, * nr_active, and the list: diff --git a/kernel/events/core.c b/kernel/events/core.c index 3ebad2556698..26c40faa8ea4 100644 --- a/kernel/events/core.c +++ b/kernel/events/core.c @@ -6803,7 +6803,6 @@ skip_type: __perf_event_init_context(&cpuctx->ctx); lockdep_set_class(&cpuctx->ctx.mutex, &cpuctx_mutex); lockdep_set_class(&cpuctx->ctx.lock, &cpuctx_lock); - cpuctx->ctx.type = cpu_context; cpuctx->ctx.pmu = pmu; __perf_cpu_hrtimer_init(cpuctx, cpu); @@ -7445,7 +7444,19 @@ SYSCALL_DEFINE5(perf_event_open, * task or CPU context: */ if (move_group) { - if (group_leader->ctx->type != ctx->type) + /* + * Make sure we're both on the same task, or both + * per-cpu events. + */ + if (group_leader->ctx->task != ctx->task) + goto err_context; + + /* + * Make sure we're both events for the same CPU; + * grouping events for different CPUs is broken; since + * you can never concurrently schedule them anyhow. + */ + if (group_leader->cpu != event->cpu) goto err_context; } else { if (group_leader->ctx != ctx)