linux-stable/kernel/events
Baptiste Lepers b89a05b21f 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")
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
2021-09-15 17:49:06 +02:00
..
callchain.c uaccess: add force_uaccess_{begin,end} helpers 2020-08-12 10:57:59 -07:00
core.c events: Reuse value read using READ_ONCE instead of re-reading it 2021-09-15 17:49:06 +02:00
hw_breakpoint.c perf/hw_breakpoint: Replace deprecated CPU-hotplug functions 2021-08-26 09:14:36 +02:00
internal.h perf: Optimize get_recursion_context() 2020-11-09 18:12:34 +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: Cap allocation order at aux_watermark 2021-04-16 16:32:39 +02:00
uprobes.c Merge branch 'akpm' (patches from Andrew) 2021-06-29 17:29:11 -07:00