android_kernel_motorola_sm6225/kernel/events
Baptiste Lepers c09a84aea0 events: Reuse value read using READ_ONCE instead of re-reading it
commit b89a05b21f46150ac10a962aa50109250b56b03b upstream.

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")
Signed-off-by: Baptiste Lepers <baptiste.lepers@gmail.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Link: https://lkml.kernel.org/r/20210906015310.12802-1-baptiste.lepers@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-09-22 11:48:11 +02:00
..
callchain.c treewide: convert ISO_8859-1 text comments to utf-8 2018-08-23 18:48:43 -07:00
core.c events: Reuse value read using READ_ONCE instead of re-reading it 2021-09-22 11:48:11 +02:00
hw_breakpoint.c perf/hw_breakpoint: Fix arch_hw_breakpoint use-before-initialization 2019-10-17 13:45:44 -07:00
internal.h perf: Fix get_recursion_context() 2020-11-18 19:18:48 +01:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
ring_buffer.c perf/ring-buffer: Always use {READ,WRITE}_ONCE() for rb->user_page data 2019-06-22 08:15:16 +02:00
uprobes.c uprobes: Change handle_swbp() to send SIGTRAP with si_code=SI_KERNEL, to fix GDB regression 2020-07-29 10:16:47 +02:00