All of lore.kernel.org
 help / color / mirror / Atom feed
* Patch "bcache: fix cache_set_flush() NULL pointer dereference on OOM" has been added to the 3.14-stable tree
@ 2016-04-10  0:59 gregkh
  0 siblings, 0 replies; only message in thread
From: gregkh @ 2016-04-10  0:59 UTC (permalink / raw)
  To: git, bcache, gregkh; +Cc: stable, stable-commits


This is a note to let you know that I've just added the patch titled

    bcache: fix cache_set_flush() NULL pointer dereference on OOM

to the 3.14-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     bcache-fix-cache_set_flush-null-pointer-dereference-on-oom.patch
and it can be found in the queue-3.14 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@vger.kernel.org> know about it.


>From f8b11260a445169989d01df75d35af0f56178f95 Mon Sep 17 00:00:00 2001
From: Eric Wheeler <git@linux.ewheeler.net>
Date: Mon, 7 Mar 2016 15:17:50 -0800
Subject: bcache: fix cache_set_flush() NULL pointer dereference on OOM

From: Eric Wheeler <git@linux.ewheeler.net>

commit f8b11260a445169989d01df75d35af0f56178f95 upstream.

When bch_cache_set_alloc() fails to kzalloc the cache_set, the
asyncronous closure handling tries to dereference a cache_set that
hadn't yet been allocated inside of cache_set_flush() which is called
by __cache_set_unregister() during cleanup.  This appears to happen only
during an OOM condition on bcache_register.

Signed-off-by: Eric Wheeler <bcache@linux.ewheeler.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/md/bcache/super.c |    3 +++
 1 file changed, 3 insertions(+)

--- a/drivers/md/bcache/super.c
+++ b/drivers/md/bcache/super.c
@@ -1388,6 +1388,9 @@ static void cache_set_flush(struct closu
 	struct btree *b;
 	unsigned i;
 
+	if (!c)
+		closure_return(cl);
+
 	bch_cache_accounting_destroy(&c->accounting);
 
 	kobject_put(&c->internal);


Patches currently in stable-queue which might be from git@linux.ewheeler.net are

queue-3.14/bcache-fix-cache_set_flush-null-pointer-dereference-on-oom.patch

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-04-10  0:59 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-10  0:59 Patch "bcache: fix cache_set_flush() NULL pointer dereference on OOM" has been added to the 3.14-stable tree gregkh

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.