From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932391AbcE3H0c (ORCPT ); Mon, 30 May 2016 03:26:32 -0400 Received: from mail-wm0-f42.google.com ([74.125.82.42]:34674 "EHLO mail-wm0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751658AbcE3H0b (ORCPT ); Mon, 30 May 2016 03:26:31 -0400 Date: Mon, 30 May 2016 09:26:28 +0200 From: Michal Hocko To: Johannes Weiner Cc: Vladimir Davydov , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: memcontrol: fix possible css ref leak on oom Message-ID: <20160530072628.GG22928@dhcp22.suse.cz> References: <1464019330-7579-1-git-send-email-vdavydov@virtuozzo.com> <20160527173629.GE2531@cmpxchg.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160527173629.GE2531@cmpxchg.org> User-Agent: Mutt/1.6.0 (2016-04-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 27-05-16 13:36:29, Johannes Weiner wrote: > On Mon, May 23, 2016 at 07:02:10PM +0300, Vladimir Davydov wrote: > > 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. > > There is a task_in_memcg_oom() check before calling mem_cgroup_oom(). > > How can this happen? Ble, I have missed that... Thanks for pointing that out -- Michal Hocko SUSE Labs