All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <ian.campbell@citrix.com>
To: Jan Beulich <JBeulich@suse.com>
Cc: tom.yeon@windriver.com,
	xen-devel <xen-devel@lists.xenproject.org>,
	Keir Fraser <keir@xen.org>,
	Ian Jackson <Ian.Jackson@eu.citrix.com>, Tim Deegan <tim@xen.org>
Subject: Re: [PATCH] LZ4 : fix the data abort issue
Date: Wed, 25 Mar 2015 16:32:51 +0000	[thread overview]
Message-ID: <1427301171.10784.95.camel@citrix.com> (raw)
In-Reply-To: <5512ECDC020000780006D8DB@mail.emea.novell.com>

On Wed, 2015-03-25 at 16:14 +0000, Jan Beulich wrote:
> If the part of the compression data are corrupted, or the compression
> data is totally fake, the memory access over the limit is possible.
> 
> This is the log from my system usning lz4 decompression.
>    [6502]data abort, halting
>    [6503]r0  0x00000000 r1  0x00000000 r2  0xdcea0ffc r3  0xdcea0ffc
>    [6509]r4  0xb9ab0bfd r5  0xdcea0ffc r6  0xdcea0ff8 r7  0xdce80000
>    [6515]r8  0x00000000 r9  0x00000000 r10 0x00000000 r11 0xb9a98000
>    [6522]r12 0xdcea1000 usp 0x00000000 ulr 0x00000000 pc  0x820149bc
>    [6528]spsr 0x400001f3
> and the memory addresses of some variables at the moment are
>     ref:0xdcea0ffc, op:0xdcea0ffc, oend:0xdcea1000
> 
> As you can see, COPYLENGH is 8bytes, so @ref and @op can access the momory
> over @oend.
> 
> Signed-off-by: JeHyeon Yeon <tom.yeon@windriver.com>
> Reviewed-by: David Sterba <dsterba@suse.cz>
> [Linux commit d5e7cafd69da24e6d6cc988fab6ea313a2577efc]
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Ian Campbell <ian.campbell@citrix.com>

> 
> --- a/xen/common/lz4/decompress.c
> +++ b/xen/common/lz4/decompress.c
> @@ -132,6 +132,9 @@ static int INIT lz4_uncompress(const uns
>  			/* Error: request to write beyond destination buffer */
>  			if (cpy > oend)
>  				goto _output_error;
> +			if ((ref + COPYLENGTH) > oend ||
> +					(op + COPYLENGTH) > oend)
> +				goto _output_error;
>  			LZ4_SECURECOPY(ref, op, (oend - COPYLENGTH));
>  			while (op < cpy)
>  				*op++ = *ref++;
> 
> 
> 

      reply	other threads:[~2015-03-25 16:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-25 16:14 [PATCH] LZ4 : fix the data abort issue Jan Beulich
2015-03-25 16:32 ` Ian Campbell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1427301171.10784.95.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=JBeulich@suse.com \
    --cc=keir@xen.org \
    --cc=tim@xen.org \
    --cc=tom.yeon@windriver.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.