Re: [PATCH stable] memcg: add refcnt for pcpu stock to avoid UAF problem in drain_all_stock()

From: Michal Hocko
Date: Wed Feb 21 2024 - 05:22:33 EST


On Wed 21-02-24 11:08:02, Michal Hocko wrote:
[...]
> You are right. Thanks! IRQ disabling is there in one form or the other
> since db2ba40c277d ("mm: memcontrol: make per-cpu charge cache IRQ-safe
> for socket accounting") so 4.8+ is safe. Backports to older kernels
> would nee to pull this one as well.

Scratch that. Prior to db2ba40c277d, we used to disable preemption via
{get,put}_cpu_var and that should achive the same result.
--
Michal Hocko
SUSE Labs