All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Wagner <wagi@monom.org>
To: linux-kernel@vger.kernel.org
Cc: linux-rt-users <linux-rt-users@vger.kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Carsten Emde <C.Emde@osadl.org>, John Kacur <jkacur@redhat.com>,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Julia Cartwright <julia@ni.com>,
	Daniel Wagner <daniel.wagner@siemens.com>,
	tom.zanussi@linux.intel.com,
	Sebastian Andrzej Siewior <bigeasy@linutronix.de>,
	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	[thread overview]
Message-ID: <20180404071652.24196-4-wagi@monom.org> (raw)
In-Reply-To: <20180404071652.24196-1-wagi@monom.org>

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>

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 <bigeasy@linutronix.de>
---
 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

  parent reply	other threads:[~2018-04-04  7:16 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-04  7:16 [PATCH RT 0/7] 4.4.126-rt141-rc1 Daniel Wagner
2018-04-04  7:16 ` [PATCH RT 1/7] locking: add types.h Daniel Wagner
2018-04-04  7:16 ` [PATCH RT 2/7] timer: Invoke timer_start_debug() where it makes sense Daniel Wagner
2018-04-04  7:16 ` Daniel Wagner [this message]
2018-04-04  7:16 ` [PATCH RT 4/7] arm*: disable NEON in kernel mode Daniel Wagner
2018-04-04  7:16 ` [PATCH RT 5/7] crypto: limit more FPU-enabled sections Daniel Wagner
2018-04-04  7:16 ` [PATCH RT 6/7] Revert "memcontrol: Prevent scheduling while atomic in cgroup code" Daniel Wagner
2018-04-04  7:16 ` [PATCH RT 7/7] Linux 4.4.126-rt141-rc1 Daniel Wagner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180404071652.24196-4-wagi@monom.org \
    --to=wagi@monom.org \
    --cc=C.Emde@osadl.org \
    --cc=bigeasy@linutronix.de \
    --cc=daniel.wagner@siemens.com \
    --cc=jkacur@redhat.com \
    --cc=julia@ni.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    --cc=rostedt@goodmis.org \
    --cc=stable-rt@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=tom.zanussi@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.