mm: memcontrol: fix possible css ref leak on oom
Subsystems (2)
[email protected]
maintainerPATCH 3/84 mm: memcontrol: fix possible css ref leak on oom
From: Vladimir Davydov <[email protected]>
Subject: mm: memcontrol: fix possible css ref leak on oom
mem_cgroup_oom may be invoked multiple times while a process is handling a page fault, in which case current->memcg_in_oom will be overwritten leaking the previously taken css reference.
Signed-off-by Vladimir Davydov <[email protected]>
Acked-by Michal Hocko <[email protected]>
Cc Johannes Weiner <[email protected]>
Signed-off-by Andrew Morton <[email protected]>
---
mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
mm/memcontrol.c renamed from mm/memcontrol.c~mm-memcontrol-fix-possible-css-ref-leak-on-oom +1 -1
@@ -1604,7 +1604,7 @@ static void memcg_oom_recover(struct memstatic void mem_cgroup_oom (struct mem_cgroup *memcg,gfp_t mask,int order) { -if (!current->memcg_may_oom) +if (!current->memcg_may_oom || current->memcg_in_oom)return ;/* * We are in the middle of the charge context here, so we
_