* Patch "of: fdt: add missing allocation-failure check" has been added to the 4.4-stable tree
@ 2017-05-22 17:03 gregkh
0 siblings, 0 replies; only message in thread
From: gregkh @ 2017-05-22 17:03 UTC (permalink / raw)
To: johan, gregkh, robh; +Cc: stable, stable-commits
This is a note to let you know that I've just added the patch titled
of: fdt: add missing allocation-failure check
to the 4.4-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:
of-fdt-add-missing-allocation-failure-check.patch
and it can be found in the queue-4.4 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 49e67dd17649b60b4d54966e18ec9c80198227f0 Mon Sep 17 00:00:00 2001
From: Johan Hovold <johan@kernel.org>
Date: Wed, 17 May 2017 17:29:09 +0200
Subject: of: fdt: add missing allocation-failure check
From: Johan Hovold <johan@kernel.org>
commit 49e67dd17649b60b4d54966e18ec9c80198227f0 upstream.
The memory allocator passed to __unflatten_device_tree() (e.g. a wrapped
kzalloc) can fail so add the missing sanity check to avoid dereferencing
a NULL pointer.
Fixes: fe14042358fa ("of/flattree: Refactor unflatten_device_tree and add fdt_unflatten_tree")
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/of/fdt.c | 3 +++
1 file changed, 3 insertions(+)
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -416,6 +416,9 @@ static void __unflatten_device_tree(cons
/* Allocate memory for the expanded device tree */
mem = dt_alloc(size + 4, __alignof__(struct device_node));
+ if (!mem)
+ return NULL;
+
memset(mem, 0, size);
*(__be32 *)(mem + size) = cpu_to_be32(0xdeadbeef);
Patches currently in stable-queue which might be from johan@kernel.org are
queue-4.4/watchdog-pcwd_usb-fix-null-deref-at-probe.patch
queue-4.4/of-fdt-add-missing-allocation-failure-check.patch
queue-4.4/ath9k_htc-fix-null-deref-at-probe.patch
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-05-22 17:05 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-22 17:03 Patch "of: fdt: add missing allocation-failure check" has been added to the 4.4-stable tree gregkh
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).