Re: [PATCH] mm/slab: disallow kfree_rcu_sheaf() on PREEMPT_RT again

From: Harry Yoo

Date: Fri Sep 04 2026 - 06:39:18 EST


On Mon, Aug 31, 2026 at 06:02:38PM +0200, Vlastimil Babka (SUSE) wrote:
> This partially reverts commit 2a8bb29ec9b2 ("mm/slab: allow
> kfree_rcu_sheaf() on PREEMPT_RT"). It was based on an assumption that
> local_trylock() is safe on PREEMPT_RT from any context.
>
> However kvfree_rcu() is also called by set_cpus_allowed_force() with
> task_struct::pi_lock acquired and there it's not safe, as syzbot
> has reported.
>
> For the immediate fix, skip kfree_rcu_sheaf() on PREEMPT_RT again from
> kvfree_call_rcu(). In theory, kfree_rcu_nolock() would have the same
> problem when called from under pi_lock on PREEMPT_RT but that can
> be addressed if such a caller is proposed.
>
> Add an explanation comment, courtesy of Sebastian.
>
> Reported-by: syzbot+acf142088e0182172e58@xxxxxxxxxxxxxxxxxxxxxxxxx
> Closes: https://syzkaller.appspot.com/bug?extid=acf142088e0182172e58
> Reported-by: ThangNN99 <ngocthang2710.1999@xxxxxxxxx>
> Fixes: 2a8bb29ec9b2 ("mm/slab: allow kfree_rcu_sheaf() on PREEMPT_RT")
> Signed-off-by: Vlastimil Babka (SUSE) <vbabka@xxxxxxxxxx>
> ---

Looks good to me,
Reviewed-by: Harry Yoo (Meta) <harry@xxxxxxxxxx>

--
Cheers,
Harry / Hyeonggon