From: Zqiang Date: Fri, 20 Nov 2020 14:53:11 +0000 (-0800) Subject: rcu: Record kvfree_call_rcu() call stack for KASAN X-Git-Tag: accepted/tizen/unified/20230118.172025~7851^2~1^2^3~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=84109ab58590dc6c4e7eb36329fdc7ec121ed5a5;p=platform%2Fkernel%2Flinux-rpi.git 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 Reviewed-by: Uladzislau Rezki (Sony) Signed-off-by: Zqiang Signed-off-by: Paul E. McKenney --- diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c index 40e5e3d..2db736c 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);