summaryrefslogtreecommitdiffstats
path: root/kernel/rcu
diff options
context:
space:
mode:
authorZqiang <qiang.zhang@windriver.com>2020-11-20 15:53:11 +0100
committerPaul E. McKenney <paulmck@kernel.org>2021-01-04 22:42:04 +0100
commit84109ab58590dc6c4e7eb36329fdc7ec121ed5a5 (patch)
treed4629bc98f7f3c5a492b2cb567540eeea7ed3ad9 /kernel/rcu
parentLinux 5.11-rc1 (diff)
downloadlinux-84109ab58590dc6c4e7eb36329fdc7ec121ed5a5.tar.xz
linux-84109ab58590dc6c4e7eb36329fdc7ec121ed5a5.zip
rcu: Record kvfree_call_rcu() call stack for KASAN
This commit adds a call to kasan_record_aux_stack() in kvfree_call_rcu() in order to record the call stack of the code that caused the object to be freed. Please note that this function does not update the allocated/freed state, which is important because RCU readers might still be referencing this object. Acked-by: Dmitry Vyukov <dvyukov@google.com> Reviewed-by: Uladzislau Rezki (Sony) <urezki@gmail.com> Signed-off-by: Zqiang <qiang.zhang@windriver.com> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'kernel/rcu')
-rw-r--r--kernel/rcu/tree.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
index 40e5e3dd253e..2db736cbe342 100644
--- a/kernel/rcu/tree.c
+++ b/kernel/rcu/tree.c
@@ -3498,6 +3498,7 @@ void kvfree_call_rcu(struct rcu_head *head, rcu_callback_t func)
goto unlock_return;
}
+ kasan_record_aux_stack(ptr);
success = kvfree_call_rcu_add_ptr_to_bulk(krcp, ptr);
if (!success) {
run_page_cache_worker(krcp);