Re: [PATCH 2/3] blk-cgroup: fix uaf in blkcg_activate_policy() racing with blkg_free_workfn()
From: Yu Kuai
Date: Fri Jan 09 2026 - 01:44:04 EST
Hi,
在 2026/1/9 14:22, Zheng Qixing 写道:
> I tried adding blkcg_mutex protection in blkcg_activate_policy() and
> blkg_destroy_all() as suggested.
>
> Unfortunately, the UAF still occurs even with proper mutex protection.
>
> The mutex successfully protects the list structure during traversal
> won't be added/removed from
>
> q->blkg_list while we hold the lock. However, this doesn't prevent the
> same blkg from being released
>
> twice.
I don't understand, what I suggested should actually include your changes in this patch. Can you
show your changes and make sure blkcg_policy_teardown_pds() inside blkcg_activate_policy() is
also protected.
--
Thansk,
Kuai