All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Alexandru Gagniuc <mr.nuke.me@gmail.com>
Cc: u-boot@lists.denx.de, marex@denx.de
Subject: Re: [PATCH] image: Avoid erroneous double byte-swap in CRC value
Date: Tue, 14 Sep 2021 18:44:42 -0400	[thread overview]
Message-ID: <20210914224442.GQ12964@bill-the-cat> (raw)
In-Reply-To: <20210914205333.3519115-1-mr.nuke.me@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 948 bytes --]

On Tue, Sep 14, 2021 at 03:53:33PM -0500, Alexandru Gagniuc wrote:

> The hash algorithm selection was streamlined in commit 92055e138f28
> ("image: Drop if/elseif hash selection in calculate_hash()"). Said
> commit kept the call to cpu_to_uimage() to convert the CRC to big
> endian format.
> 
> This would have been correct when calling crc32_wd(). However, the
> ->hash_func_ws member of crc32 points to crc32_wd_buf(), which already
> converts the CRC to big endian. On a little endian host, doing both
> conversions results in a little-endian CRC. This is incorrect.
> 
> To remedy this, simply drop the call to cpu_to_uimage(), thus only
> doing the byte-order conversion once.
> 
> Fixes: 92055e138f28 ("image: Drop if/elseif hash selection in
>        calculate_hash()")
> Tested-by: Tom Rini <trini@konsulko.com>
> Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

      reply	other threads:[~2021-09-14 22:45 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-14 20:53 [PATCH] image: Avoid erroneous double byte-swap in CRC value Alexandru Gagniuc
2021-09-14 22:44 ` Tom Rini [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=20210914224442.GQ12964@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=marex@denx.de \
    --cc=mr.nuke.me@gmail.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 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.