diff options
author | Alexey Kardashevskiy <aik@ozlabs.ru> | 2021-02-02 10:23:26 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-02-10 11:29:16 +0300 |
commit | 059e68da31b024967fd2371d42349d03f2b52df8 (patch) | |
tree | 1d85a2d7cea72cc637310cf1c23c87bee9a5d83c /drivers/nvdimm | |
parent | 9e4a668f4f0ac136cb4a8df2c765d8d00d65774b (diff) | |
download | linux-059e68da31b024967fd2371d42349d03f2b52df8.tar.xz |
tracepoint: Fix race between tracing and removing tracepoint
commit c8b186a8d54d7e12d28e9f9686cb00ff18fc2ab2 upstream.
When executing a tracepoint, the tracepoint's func is dereferenced twice -
in __DO_TRACE() (where the returned pointer is checked) and later on in
__traceiter_##_name where the returned pointer is dereferenced without
checking which leads to races against tracepoint_removal_sync() and
crashes.
This adds a check before referencing the pointer in tracepoint_ptr_deref.
Link: https://lkml.kernel.org/r/20210202072326.120557-1-aik@ozlabs.ru
Cc: stable@vger.kernel.org
Fixes: d25e37d89dd2f ("tracepoint: Optimize using static_call()")
Acked-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/nvdimm')
0 files changed, 0 insertions, 0 deletions