Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755231AbaLHOtf (ORCPT ); Mon, 8 Dec 2014 09:49:35 -0500 Received: from resqmta-po-08v.sys.comcast.net ([96.114.154.167]:34470 "EHLO resqmta-po-08v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750908AbaLHOte (ORCPT ); Mon, 8 Dec 2014 09:49:34 -0500 Date: Mon, 8 Dec 2014 08:49:31 -0600 (CST) From: Christoph Lameter X-X-Sender: cl@gentwo.org To: Vladimir Davydov cc: Andrew Morton , Johannes Weiner , Michal Hocko , Pekka Enberg , David Rientjes , Joonsoo Kim , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH -mm] memcg: fix possible use-after-free in memcg_kmem_get_cache In-Reply-To: <1417969947-4072-1-git-send-email-vdavydov@parallels.com> Message-ID: References: <1417969947-4072-1-git-send-email-vdavydov@parallels.com> Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 7 Dec 2014, Vladimir Davydov wrote: > diff --git a/mm/slub.c b/mm/slub.c > index 95d214255663..7ddf01e2a465 100644 > --- a/mm/slub.c > +++ b/mm/slub.c > @@ -2450,6 +2450,7 @@ redo: > > slab_post_alloc_hook(s, gfpflags, object); > > + memcg_kmem_put_cache(s); > return object; > } The function should be added to slab_post_alloc(). Also move the memcg_kmem_get_cache() into slab_pre_alloc_hook(). -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/