lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 18 May 2016 14:36:31 -0500
From:	Rob Herring <robh@...nel.org>
To:	Sasha Levin <sasha.levin@...cle.com>,
	Rhyland Klein <rklein@...dia.com>,
	Gavin Shan <gwshan@...ux.vnet.ibm.com>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	Grant Likely <grant.likely@...aro.org>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>
Subject: Re: drivers/of: crash on boot

On Wed, May 18, 2016 at 10:34 AM, Sasha Levin <sasha.levin@...cle.com> wrote:
> Hi Rhyland,
>
> I'm seeing a crash on boot that seems to have been caused by
> "drivers/of: Fix depth when unflattening devicetree":
>
> [   61.145229] ==================================================================
>
> [   61.147588] BUG: KASAN: stack-out-of-bounds in unflatten_dt_nodes+0x11d2/0x1290 at addr ffff88005b30777c

The following appears to fix it for me. Rhyland, please confirm.

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index 7f38241..888ec2a 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -409,7 +409,7 @@ static int unflatten_dt_nodes(const void *blob,
        fpsizes[depth] = dad ? strlen(of_node_full_name(dad)) : 0;
        nps[depth+1] = dad;
        for (offset = 0;
-            offset >= 0;
+            offset >= 0, depth >= 0;
             offset = fdt_next_node(blob, offset, &depth)) {
                if (WARN_ON_ONCE(depth >= FDT_MAX_DEPTH))
                        continue;

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ