[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <E1UjUsY-0008Td-Bj@jdl.com>
Date: Mon, 03 Jun 2013 08:32:54 -0500
From: Jon Loeliger <jdl@....com>
To: Stephen Warren <swarren@...dotorg.org>
cc: David Gibson <david@...son.dropbear.id.au>,
devicetree-discuss@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org, mmarek@...e.cz,
rob.herring@...xeda.com, grant.likely@...retlab.ca,
linux-kbuild@...r.kernel.org, Stephen Warren <swarren@...dia.com>
Subject: Re: [PATCH V2] dtc: ensure #line directives don't consume data from the next line
> From: Stephen Warren <swarren@...dia.com>
>
> Previously, the #line parsing regex ended with ({WS}+[0-9]+)?. The {WS}
> could match line-break characters. If the #line directive did not contain
> the optional flags field at the end, this could cause any integer data on
> the next line to be consumed as part of the #line directive parsing. This
> could cause syntax errors (i.e. #line parsing consuming the leading 0
> from a hex literal 0x1234, leaving x1234 to be parsed as cell data,
> which is a syntax error), or invalid compilation results (i.e. simply
> consuming literal 1234 as part of the #line processing, thus removing it
> from the cell data).
>
> Fix this by replacing {WS} with [ \t] so that it can't match line-breaks.
>
> Convert all instances of {WS}, even though the other instances should be
> irrelevant for any well-formed #line directive. This is done for
> consistency and ultimate safety.
>
> Reported-by: Ian Campbell <Ian.Campbell@...rix.com>
> Signed-off-by: Stephen Warren <swarren@...dia.com>
> ---
> v2: Convert all instances of {WS} in the regex.
Applied.
Thanks!
jdl
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists