Received: by 10.213.65.68 with SMTP id h4csp417811imn; Wed, 4 Apr 2018 00:20:33 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Vn1UfgtJWiCf6VliuDwYTh6AEPQ7WuVR0ZEkexJ+t+EgoWGAsxvuys5lc/85dkoUWqSia X-Received: by 10.101.83.7 with SMTP id m7mr11244075pgq.1.1522826433617; Wed, 04 Apr 2018 00:20:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522826433; cv=none; d=google.com; s=arc-20160816; b=ENRcllAShx8fSfuuJdcrR3c16tdknEKpZjoMMXYLZ3qP545a4GFbKFf8RhE3CKfmH6 2WAGW8KFZuS05+sYvFpIkSANSoT5+U4AooDFrXJXi3sFOdBQWBmBRr1UgyyZsnz6faHY +HfN89SgdJB0onlxKWkJXj+s6FAuInCzjMZj48d1ECqFeBx5khDH1EIFieeDcJzRSA4W DX3z5gQAK+uWNMzjtp0ah2V/x6f4l1gkixBgK5ReYlqCIuU5YEkrIeWvR8OaitakmG1a gM1a3hv/qOd7Z/a++lQujDQ/j09onJJNp6R731faq6Lxg6Jw7Lilrhp3zLgaBu/lTS/8 Efdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=DdFZ0+ayMJ5mP9yhiSJeek6Jy9tquBnRQHuDFQSrww8=; b=SD0fsn2H9ZIz4KuERnEalYUTgosK3ZzbHSOcd9tKOe/mxzmCFDnNggR1jOJZJKcU4V 9uth2e0cHuCmtgmGlFhBmtFwZvVjDcapB7cGdl/2dykhqDakx49L+Yr0MxBwF4n2xadh r6PiSKOUsWWHK57h1OIyz0MvLAUblyE/QWpaITBqnG32p1Eb1akq83aXgmrLFOgcHw7U NqMBsCVdD7C1uYtlHUDI5FeH7DdapkIAq1Ef16k/jftuSy9jizCu16UkYZbLKC3ccw3A jtXViCducIOHkAAf+QDjaAZwC1IwZUFVSFAVJ6fN2rLHvEtv4G965aJhjiiWaNgILGl2 fxow== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=monom.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e12si3599443pff.366.2018.04.04.00.20.19; Wed, 04 Apr 2018 00:20:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=monom.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751606AbeDDHSl (ORCPT + 99 others); Wed, 4 Apr 2018 03:18:41 -0400 Received: from mail.monom.org ([188.138.9.77]:49550 "EHLO mail.monom.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750762AbeDDHRP (ORCPT ); Wed, 4 Apr 2018 03:17:15 -0400 Received: from mail.monom.org (localhost [127.0.0.1]) by filter.mynetwork.local (Postfix) with ESMTP id 1BB89500C3E; Wed, 4 Apr 2018 09:17:13 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on mail.monom.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 Received: from localhost (ppp-93-104-185-33.dynamic.mnet-online.de [93.104.185.33]) by mail.monom.org (Postfix) with ESMTPSA id C9D13500A56; Wed, 4 Apr 2018 09:17:12 +0200 (CEST) From: Daniel Wagner To: linux-kernel@vger.kernel.org Cc: linux-rt-users , Steven Rostedt , Thomas Gleixner , Carsten Emde , John Kacur , Paul Gortmaker , Julia Cartwright , Daniel Wagner , tom.zanussi@linux.intel.com, Sebastian Andrzej Siewior , stable-rt@vger.kernel.org Subject: [PATCH RT 3/7] mm/slub: close possible memory-leak in kmem_cache_alloc_bulk() Date: Wed, 4 Apr 2018 09:16:48 +0200 Message-Id: <20180404071652.24196-4-wagi@monom.org> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180404071652.24196-1-wagi@monom.org> References: <20180404071652.24196-1-wagi@monom.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sebastian Andrzej Siewior Under certain circumstances we could leak elements which were moved to the local "to_free" list. The damage is limited since I can't find any users here. Cc: stable-rt@vger.kernel.org Signed-off-by: Sebastian Andrzej Siewior --- mm/slub.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/slub.c b/mm/slub.c index b183c5271607..b3626ab324fe 100644 --- a/mm/slub.c +++ b/mm/slub.c @@ -3026,6 +3026,7 @@ int kmem_cache_alloc_bulk(struct kmem_cache *s, gfp_t flags, size_t size, return i; error: local_irq_enable(); + free_delayed(&to_free); slab_post_alloc_hook(s, flags, i, p); __kmem_cache_free_bulk(s, i, p); return 0; -- 2.14.3