public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Hans de Goede <hdegoede@redhat.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] sunxi: Ensure that 'mksunxiboot' tool produces deterministic output
Date: Thu, 10 Sep 2015 20:21:09 +0200	[thread overview]
Message-ID: <55F1CA15.5070401@redhat.com> (raw)
In-Reply-To: <1441236999-31780-1-git-send-email-siarhei.siamashka@gmail.com>

Hi,

On 03-09-15 01:36, Siarhei Siamashka wrote:
> Currently some uninitialized padding bytes are written to the output
> file, as can be confirmed with valgrind:
>
> $ valgrind tools/mksunxiboot spl/u-boot-spl.bin spl/sunxi-spl.bin
>
> ==5581== Syscall param write(buf) points to uninitialised byte(s)
> ==5581==    at 0x4F0F940: __write_nocancel (in /lib64/libc-2.20.so)
> ==5581==    by 0x400839: main (in /tmp/u-boot/tools/mksunxiboot)
> ==5581==  Address 0xffeff5d3c is on thread 1's stack
> ==5581==  in frame #1, created by main (???)
>
> This patch fixes the problem by clearing the whole structure instead
> of just a portion of it.
>
> Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>

Thanks, I've queued this one up for the next pull-req.

Regards,

Hans

> ---
>   tools/mksunxiboot.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/mksunxiboot.c b/tools/mksunxiboot.c
> index 3361251..676d392 100644
> --- a/tools/mksunxiboot.c
> +++ b/tools/mksunxiboot.c
> @@ -99,7 +99,7 @@ int main(int argc, char *argv[])
>   		return EXIT_FAILURE;
>   	}
>
> -	memset(img.pad, 0, BLOCK_SIZE);
> +	memset(&img, 0, sizeof(img));
>
>   	/* get input file size */
>   	file_size = lseek(fd_in, 0, SEEK_END);
>

      reply	other threads:[~2015-09-10 18:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-02 23:36 [U-Boot] [PATCH] sunxi: Ensure that 'mksunxiboot' tool produces deterministic output Siarhei Siamashka
2015-09-10 18:21 ` Hans de Goede [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=55F1CA15.5070401@redhat.com \
    --to=hdegoede@redhat.com \
    --cc=u-boot@lists.denx.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox