All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Alejandro Zeise <alejandro.zeise@seagate.com>
Cc: qemu-arm@nongnu.org, kris.conklin@seagate.com,
	jonathan.henze@seagate.com, evan.burgess@seagate.com,
	clg@kaod.org, peter.maydell@linaro.org, qemu-devel@nongnu.org
Subject: Re: [PATCH v3 00/12] hw/misc/aspeed_hace: Fix SG Accumulative Hash Calculations
Date: Tue, 6 Aug 2024 16:52:47 +0100	[thread overview]
Message-ID: <ZrJGzxtvzJ49aGln@redhat.com> (raw)
In-Reply-To: <20240805155047.3151540-1-alejandro.zeise@seagate.com>

On Mon, Aug 05, 2024 at 03:50:35PM +0000, Alejandro Zeise wrote:
> The goal of this patch series is to fix accumulative hashing support in the 
> Aspeed HACE module. The issue that stemmed this patch was a failure to boot an
> OpenBMC image using the "ast2600-evb" machine. The U-boot
> 2019.04 loader failed to verify image hashes.
> 
> These incorrect image hashes given by the HACE to the U-boot guest are due to 
> an oversight in the HACE module. Previously when operating in 
> scatter-gather accumulative mode, the HACE would cache the address provided by 
> the guest which contained the source data. However, there was no deep copy, 
> so when HACE generated the digest upon the reception of the final accumulative chunk 
> the digest was incorrect, as the addresses provided had their regions overwritten
> by that time.
> 
> This fix consists of two main steps:
> * Add an accumulative hashing function to the qcrypto library
> * Modify the HACE module to use the accumulative hashing functions
> 
> All the crypto library backends (nettle, gnutls, etc.) support accumulative hashing,
> so it was trivial to create wrappers for those functions.
> 
> Changes in V3:
> * Reworked crypto hash API with comments from Daniel
>   * Creation/Deletion of contexts, updating, and finalizing
>   * Modified existing API functions to use the new 4 main core functions
>   * Added test for accumulative hashing
>   * Added afalg driver implementation
> * Fixed bug in HACE module where hash context fails to allocate,
>   causing the HACE internal state to be incorrect and segfault.
> 
> Changes in V2:
> * Fixed error checking bug in libgcrypt crypto backend of
>   accumulate_bytesv
> 
> Alejandro Zeise (12):
>   crypto: accumulative hashing API
>   crypto/hash-glib: Remove old hash API implementation
>   crypto/hash-glib: Implement new hash API
>   crypto/hash-gcrypt: Remove old hash API implementation
>   crypto/hash-gcrypt: Implement new hash API
>   crypto/hash-gnutls: Remove old hash API
>   crypto/hash-gnutls: Implement new hash API
>   crypto/hash-nettle: Remove old hash API
>   crypto/hash-nettle: Implement new hash API
>   crypto/hash-afalg: Update to new API
>   tests/unit/test-crypto-hash: accumulative hashing
>   hw/misc/aspeed_hace: Fix SG Accumulative hashing

To allow 'make check' to succeed at every individual patch, you'll need to
re-order these, and split a couple of patches, to be more or less like this:

   crypto: accumulative hashing API   (only define new driver APIs & new public APIs here)
   crypto/hash-glib: Implement new hash API
   crypto/hash-gcrypt: Implement new hash API
   crypto/hash-gnutls: Implement new hash API
   crypto/hash-nettle: Implement new hash API
   crypto/hash-afalg: Update to new API  (only add new APIs here )
   < convert old public APIs to call the new driver APIs here>
   tests/unit/test-crypto-hash: accumulative hashing
   crypto/hash-glib: Remove old hash API implementation
   crypto/hash-gcrypt: Remove old hash API implementation
   crypto/hash-gnutls: Remove old hash API
   crypto/hash-nettle: Remove old hash API
   < remove old afalg support here >
   < remove old driver APIs here >
   hw/misc/aspeed_hace: Fix SG Accumulative hashing


With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|


  parent reply	other threads:[~2024-08-06 15:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-05 15:50 [PATCH v3 00/12] hw/misc/aspeed_hace: Fix SG Accumulative Hash Calculations Alejandro Zeise
2024-08-05 15:50 ` [PATCH v3 01/12] crypto: accumulative hashing API Alejandro Zeise
2024-08-06 15:45   ` Daniel P. Berrangé
2024-08-05 15:50 ` [PATCH v3 02/12] crypto/hash-glib: Remove old hash API implementation Alejandro Zeise
2024-08-05 15:50 ` [PATCH v3 03/12] crypto/hash-glib: Implement new hash API Alejandro Zeise
2024-08-05 15:50 ` [PATCH v3 04/12] crypto/hash-gcrypt: Remove old hash API implementation Alejandro Zeise
2024-08-05 15:50 ` [PATCH v3 05/12] crypto/hash-gcrypt: Implement new hash API Alejandro Zeise
2024-08-05 15:50 ` [PATCH v3 06/12] crypto/hash-gnutls: Remove old " Alejandro Zeise
2024-08-05 15:50 ` [PATCH v3 07/12] crypto/hash-gnutls: Implement new " Alejandro Zeise
2024-08-05 15:50 ` [PATCH v3 08/12] crypto/hash-nettle: Remove old " Alejandro Zeise
2024-08-05 15:50 ` [PATCH v3 09/12] crypto/hash-nettle: Implement new " Alejandro Zeise
2024-08-05 15:50 ` [PATCH v3 10/12] crypto/hash-afalg: Update to new API Alejandro Zeise
2024-08-05 15:50 ` [PATCH v3 11/12] tests/unit/test-crypto-hash: accumulative hashing Alejandro Zeise
2024-08-05 15:50 ` [PATCH v3 12/12] hw/misc/aspeed_hace: Fix SG Accumulative hashing Alejandro Zeise
2024-08-06 15:52 ` Daniel P. Berrangé [this message]
2024-08-06 18:51   ` [PATCH v3 00/12] hw/misc/aspeed_hace: Fix SG Accumulative Hash Calculations Alejandro Zeise

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=ZrJGzxtvzJ49aGln@redhat.com \
    --to=berrange@redhat.com \
    --cc=alejandro.zeise@seagate.com \
    --cc=clg@kaod.org \
    --cc=evan.burgess@seagate.com \
    --cc=jonathan.henze@seagate.com \
    --cc=kris.conklin@seagate.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.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.