[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190729062500.GB9330@dhcp22.suse.cz>
Date: Mon, 29 Jul 2019 08:25:00 +0200
From: Michal Hocko <mhocko@...nel.org>
To: Miles Chen <miles.chen@...iatek.com>
Cc: Johannes Weiner <hannes@...xchg.org>,
Vladimir Davydov <vdavydov.dev@...il.com>,
cgroups@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, linux-mediatek@...ts.infradead.org,
wsd_upstream@...iatek.com
Subject: Re: [PATCH v2] mm: memcontrol: fix use after free in
mem_cgroup_iter()
On Sat 27-07-19 07:47:58, Miles Chen wrote:
> On Fri, 2019-07-26 at 14:55 +0200, Michal Hocko wrote:
[...]
> > > I am sorry, I didn't get to comment an earlier version but I am
> > > wondering whether it makes more sense to do and explicit invalidation.
> > >
>
> I think we should keep the original v2 version, the reason is the
> !use_hierarchy does not imply we can reach root_mem_cgroup:
>
> cd /sys/fs/cgroup/memory/0
> mkdir 1
> cd /sys/fs/cgroup/memory/0/1
> echo 1 > memory.use_hierarchy // only 1 and its children has
> use_hierarchy set
> mkdir 2
>
> rmdir 2 // parent_mem_cgroup(2) goes up to 1
You are right I have missed this case. I am not sure anybody is using
layout like that but your fix is more robust and catches that case as
well.
Acked-by: Michal Hocko <mhocko@...e.com>
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists