Re: [syzbot] [bpf?] possible deadlock in kvfree_call_rcu

From: Uladzislau Rezki
Date: Sun Mar 31 2024 - 03:26:11 EST


On Sun, Mar 31, 2024 at 02:23:14PM +0800, Hillf Danton wrote:
> On Sat, 30 Mar 2024 18:55:41 +0100 Uladzislau Rezki <urezki@xxxxxxxxx>
> > diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
> > index d9642dd06c25..8867aac3668c 100644
> > --- a/kernel/rcu/tree.c
> > +++ b/kernel/rcu/tree.c
> > @@ -3467,19 +3467,19 @@ void kvfree_call_rcu(struct rcu_head *head, void *ptr)
> > */
> > kmemleak_ignore(ptr);
> >
> > - // Set timer to drain after KFREE_DRAIN_JIFFIES.
> > - if (rcu_scheduler_active == RCU_SCHEDULER_RUNNING)
> > - schedule_delayed_monitor_work(krcp);
> > -
>
> This is not enough at least WRT run_page_cache_worker() [1]
>
> [1] https://lore.kernel.org/lkml/0000000000007a44120614e27cb7@xxxxxxxxxx/
>
page-cache-worker should be move out of the krcp-lock also. I will
update the patch.

--
Uladzislau Rezki