Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753250AbbDONAb (ORCPT ); Wed, 15 Apr 2015 09:00:31 -0400 Received: from mail-wg0-f52.google.com ([74.125.82.52]:33066 "EHLO mail-wg0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751575AbbDONAY (ORCPT ); Wed, 15 Apr 2015 09:00:24 -0400 MIME-Version: 1.0 In-Reply-To: <20150415121515.8E1FAC40A0B@trevor.secretlab.ca> References: <1428986165-6250-1-git-send-email-jcliang@chromium.org> <20150415121515.8E1FAC40A0B@trevor.secretlab.ca> From: Rob Herring Date: Wed, 15 Apr 2015 08:00:02 -0500 Message-ID: Subject: Re: [PATCH] of/fdt: fix allocation size for device node path To: Grant Likely Cc: Ricky Liang , Rob Herring , "open list:OPEN FIRMWARE AND..." , open list Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1437 Lines: 48 On Wed, Apr 15, 2015 at 7:15 AM, Grant Likely wrote: > On Tue, 14 Apr 2015 12:36:05 +0800 > , Ricky Liang > wrote: >> The allocation size of device node path is off by one which drops the >> '\0' terminator. >> >> Signed-off-by: Ricky Liang > > This looks like something that should be backported to stable. Do you agree? I've applied, but didn't tag it. I'll send it for stable once it is in Linus' tree. BTW, it only affects old dtb versions less than 0x10 because allocl is overwritten in the 'if' statement just below here. Rob > > g. > >> --- >> drivers/of/fdt.c | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c >> index 3a896c9..98a9e6e 100644 >> --- a/drivers/of/fdt.c >> +++ b/drivers/of/fdt.c >> @@ -172,7 +172,7 @@ static void * unflatten_dt_node(void *blob, >> if (!pathp) >> return mem; >> >> - allocl = l++; >> + allocl = ++l; >> >> /* version 0x10 has a more compact unit name here instead of the full >> * path. we accumulate the full path size using "fpsize", we'll rebuild >> -- >> 2.1.2 >> > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/