On Thu, 18 Dec 2025 09:53:16 -0800
Alexei Starovoitov <[email protected]> wrote:

> > +static void bpf_kprobe_unregister(struct bpf_kprobe *kps, u32 cnt)
> > +{
> > +       for (int i = 0; i < cnt; i++)
> > +               unregister_kretprobe(&kps[i].rp);
> > +}  
> 
> Nack.
> This is not a good idea.
> unregister_kretprobe() calls synchronize_rcu().
> So the above loop will cause soft lockups for sure.

Looks like it could be replaced with:

        unregister_kretprobes(kps, cnt);

Which unregisters an array of kreptrobes and does a single
synchronize_rcu().

-- Steve

Reply via email to