The BPF trampoline calls rcu_read_unlock() on its exit path. If the task was preempted in the RCU read-side critical section, this ends up in rcu_read_unlock_special(). When a BPF fentry or fexit program is attached to rcu_read_unlock_special() itself, the trampoline runs again before ->rcu_read_unlock_special is cleared, calls rcu_read_unlock() again, and recurses until the stack overflows: BUG: TASK stack guard page was hit at ffffc90001657ff8 ... bpf_trampoline_6442575622+0x5e/0xac rcu_read_unlock_special+0x5/0x490 __rcu_read_unlock+0x9c/0x120 rcu_read_unlock_migrate+0x93/0x220 bpf_trampoline_6442575622+0x5e/0xac rcu_read_unlock_special+0x5/0x490 ... Mark rcu_read_unlock_special() notrace. Signed-off-by: Sechang Lim --- kernel/rcu/tree_plugin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/rcu/tree_plugin.h b/kernel/rcu/tree_plugin.h index ae5d21bae7bc..a887ab69f486 100644 --- a/kernel/rcu/tree_plugin.h +++ b/kernel/rcu/tree_plugin.h @@ -746,7 +746,7 @@ static bool rcu_unlock_needs_exp_handling(struct task_struct *t, * notify RCU core processing or task having blocked during the RCU * read-side critical section. */ -static void rcu_read_unlock_special(struct task_struct *t) +static notrace void rcu_read_unlock_special(struct task_struct *t) { unsigned long flags; bool irqs_were_disabled; -- 2.56.1