linux-brain/kernel/events
Baptiste Lepers 172749c879 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 12:26:41 +02:00
..
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
callchain.c perf/core: Convert to SPDX license identifiers 2019-02-04 08:46:11 +01:00
core.c events: Reuse value read using READ_ONCE instead of re-reading it 2021-09-22 12:26:41 +02:00
hw_breakpoint.c perf/hw_breakpoint: Fix arch_hw_breakpoint use-before-initialization 2019-09-06 08:24:01 +02:00
internal.h perf: Fix get_recursion_context() 2020-11-18 19:20:28 +01:00
ring_buffer.c perf/ring-buffer: Use regular variables for nesting 2019-05-24 09:00:11 +02:00
uprobes.c uprobes: __replace_page() avoid BUG in munlock_vma_page() 2020-08-26 10:40:51 +02:00