mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 22:23:14 -04:00
events: Reuse value read using READ_ONCE instead of re-reading it
In perf_event_addr_filters_apply, the task associated with
the event (event->ctx->task) is read using READ_ONCE at the beginning
of the function checked and then re read from event->ctx->task,
voiding all guarantees of the checks. Reuse the value that was read by
READ_ONCE to ensure the consistency of the task struct throughout the
function.
Fixes: 375637bc52 ("perf/core: Introduce address range filtering")
Change-Id: Ia4f6161cfc2c95073aeaff85936efa737508c5a2
Signed-off-by: Baptiste Lepers <baptiste.lepers@xxxxxxxxx>
Signed-off-by: Peter Zijlstra (Intel) <peterz@xxxxxxxxxxxxx>
Link: https://lkml.kernel.org/r/20210906015310.12802-1-baptiste.lepers@xxxxxxxxx
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Signed-off-by: Baptiste Lepers <baptiste.lepers@xxxxxxxxx>
Git-repo: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
Git-commit: b89a05b21f46150ac10a962aa50109250b56b03b
Signed-off-by: Kishor Krishna Bhat <kishkris@codeaurora.org>
This commit is contained in:
parent
8aafd51f3a
commit
dadc47f87a
1 changed files with 1 additions and 1 deletions
|
|
@ -9343,7 +9343,7 @@ static void perf_event_addr_filters_apply(struct perf_event *event)
|
|||
return;
|
||||
|
||||
if (ifh->nr_file_filters) {
|
||||
mm = get_task_mm(event->ctx->task);
|
||||
mm = get_task_mm(task);
|
||||
if (!mm)
|
||||
goto restart;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue