[PATCH v2 03/10] rcu: Record callback registration stack for Tiny RCU
From: Kunwu Chan
Date: Tue Oct 27 2026 - 03:10:39 EST
Record the callback registration stack in call_rcu()
for KASAN diagnostics involving Tiny RCU callbacks.
Suggested-by: Zqiang <qiang.zhang@xxxxxxxxx>
Signed-off-by: Kunwu Chan <chentao@xxxxxxxxxx>
---
kernel/rcu/tiny.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/rcu/tiny.c b/kernel/rcu/tiny.c
index 656b6a682e31..bd22fa43108d 100644
--- a/kernel/rcu/tiny.c
+++ b/kernel/rcu/tiny.c
@@ -12,6 +12,7 @@
#include <linux/completion.h>
#include <linux/interrupt.h>
#include <linux/irq_work.h>
+#include <linux/kasan.h>
#include <linux/llist.h>
#include <linux/notifier.h>
#include <linux/rcupdate_wait.h>
@@ -251,6 +252,9 @@ EXPORT_SYMBOL_GPL(synchronize_rcu);
*/
void call_rcu(struct rcu_head *head, rcu_callback_t func)
{
+ /* Record the caller: the irq_work's stack says nothing about it. */
+ kasan_record_aux_stack(head);
+
if (should_rcu_defer()) {
call_rcu_defer(head, func);
return;
--
2.43.0