[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20200324182454.GE162390@mtj.duckdns.org>
Date: Tue, 24 Mar 2020 14:24:54 -0400
From: Tejun Heo <tj@...nel.org>
To: Mina Almasry <almasrymina@...gle.com>
Cc: syzbot+cac0c4e204952cf449b1@...kaller.appspotmail.com,
Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org,
Giuseppe Scrivano <gscrivan@...hat.com>,
mike.kravetz@...cle.com, rientjes@...gle.com
Subject: Re: [PATCH -next] hugetlb_cgroup: fix illegal access to memory
On Fri, Mar 13, 2020 at 03:39:20PM -0700, Mina Almasry wrote:
> This appears to be a mistake in commit faced7e0806cf ("mm: hugetlb
> controller for cgroups v2"). Essentially that commit does
> a hugetlb_cgroup_from_counter assuming that page_counter_try_charge has
> initialized counter, but if page_counter_try_charge has failed then it
> seems it does not initialize counter, so
> hugetlb_cgroup_from_counter(counter) ends up pointing to random memory,
> causing kasan to complain.
>
> Solution, simply use h_cg, instead of
> hugetlb_cgroup_from_counter(counter), since that is a reference to the
> hugetlb_cgroup anyway. After this change kasan ceases to complain.
>
> Signed-off-by: Mina Almasry <almasrymina@...gle.com>
> Reported-by: syzbot+cac0c4e204952cf449b1@...kaller.appspotmail.com
> Fixes: commit faced7e0806cf ("mm: hugetlb controller for cgroups v2")
> Cc: Andrew Morton <akpm@...ux-foundation.org>
> Cc: linux-mm@...ck.org
> Cc: linux-kernel@...r.kernel.org
> Cc: Giuseppe Scrivano <gscrivan@...hat.com>
> Cc: Tejun Heo <tj@...nel.org>
> Cc: mike.kravetz@...cle.com
> Cc: rientjes@...gle.com
Acked-by: Tejun Heo <tj@...nel.org>
Thanks.
--
tejun
Powered by blists - more mailing lists