[apparmor] [patch][parser] Fix the processing of character escape sequences

Steve Beattie steve at nxnw.org
Thu Jun 19 19:34:42 UTC 2014


On Thu, Jun 19, 2014 at 10:52:49AM -0700, John Johansen wrote:
> Fix the processing of character escape sequences
> 
> r2456 unified escape sequence processing but it results in the \\
> sequence being processed multiple times (lexer, regex conversion,
> backend pcre parsing).
> 
> What used to happen was the lexer would only convert octal sequences
> and a few special escapes, \\ would be passed through the lexer and
> the regex conversion, thus only being handled in the pcre backend.
> 
> r2456 changed that so that \\ is handled by the lexer, converting it
> to \, which is handled as an escape sequence in both the regex
> conversion and the pcre backend.
> 
> This means
>   \\001 instead of being treated as the literal \001 is treated
>   as an octal escape sequence which is rejected by the regex conversion
>   (it only allows for certain special chars).
> 
>   etc.
> 
> Fix this by ensuring the lexer does not processes \\ and passes it
> through so it is only handled in the backend as was done in the past.
> 
> Also fix front end escape sequence processing of octals etc from resulting
> in a later escape sequence.  That is \134, \d92, .. would get converted
> to \ in the lexer and then treated as an escape sequence in the regex
> conversion or pcre processing.
> 
> We fix this by converting them to the equivalent \\ sequence in the
> lexer and letting the backend processes it.
> 
> Signed-off-by: John Johansen <john.johansen at canonical.com>
Acked-by: Steve Beattie <steve at nxnw.org>

-- 
Steve Beattie
<sbeattie at ubuntu.com>
http://NxNW.org/~steve/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/apparmor/attachments/20140619/651ebcda/attachment.pgp>


More information about the AppArmor mailing list