All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrei Borzenkov <arvidjaar@gmail.com>
To: Toomas Soome <tsoome@me.com>
Cc: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH 2/2] lz4 overflow bug
Date: Thu, 16 Apr 2015 07:20:01 +0300	[thread overview]
Message-ID: <20150416072001.736b679a@opensuse.site> (raw)
In-Reply-To: <8D975920-FC91-4FB5-8707-90A40BDB74B1@me.com>

В Wed, 15 Apr 2015 23:51:16 +0300
Toomas Soome <tsoome@me.com> пишет:

> 
> hi!
> 
> yep, this old bug is not fixed in grub. cpy can (theoretically?) overflow.

You mean "length"? Or do you really mean pointer overflow?

Anyway in both cases it seems more reasonable to check when length is
computed, not after overflow, when it is already too late.

> 
> ---
>  grub-core/fs/zfs/zfs_lz4.c |    2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/grub-core/fs/zfs/zfs_lz4.c b/grub-core/fs/zfs/zfs_lz4.c
> index 1212a89..ca6445d 100644
> --- a/grub-core/fs/zfs/zfs_lz4.c
> +++ b/grub-core/fs/zfs/zfs_lz4.c
> @@ -185,6 +185,8 @@ LZ4_uncompress_unknownOutputSize(const char *source,
>  		}
>  		/* copy literals */
>  		cpy = op + length;
> +		if (cpy < op)
> +			goto _output_error;
>  		if ((cpy > oend - COPYLENGTH) ||
>  		    (ip + length > iend - COPYLENGTH)) {
>  			if (cpy > oend)



  reply	other threads:[~2015-04-16 13:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-15 20:51 [PATCH 2/2] lz4 overflow bug Toomas Soome
2015-04-16  4:20 ` Andrei Borzenkov [this message]
2015-04-16  4:51   ` Toomas Soome
2015-04-16  5:07     ` Andrei Borzenkov

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=20150416072001.736b679a@opensuse.site \
    --to=arvidjaar@gmail.com \
    --cc=grub-devel@gnu.org \
    --cc=tsoome@me.com \
    /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.