Skip to content
Commit 1dcaa3b4 authored by Paul E. McKenney's avatar Paul E. McKenney
Browse files

context_tracking: Use arch_atomic_read() in __ct_state for KASAN



Context tracking's __ct_state() function can be invoked from noinstr state
where RCU is not watching.  This means that its use of atomic_read()
causes KASAN to invoke the non-noinstr __kasan_check_read() function
from the noinstr function __ct_state().  This is problematic because
someone tracing the __kasan_check_read() function could get a nasty
surprise because of RCU not watching.

This commit therefore replaces the __ct_state() function's use of
atomic_read() with arch_atomic_read(), which KASAN does not attempt to
add instrumention to.

Reported-by: default avatarkernel test robot <lkp@intel.com>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
Cc: Frederic Weisbecker <frederic@kernel.org>
Cc: Marco Elver <elver@google.com>
Reviewed-by: default avatarMarco Elver <elver@google.com>
parent 08ab707d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment