Re: [PATCH v4 1/1] use crc32 instead of md5 for hibernation e820 integrity check

From: Simo Sorce
Date: Thu Apr 08 2021 - 09:01:59 EST


On Thu, 2021-04-08 at 06:46 -0400, Chris von Recklinghausen wrote:
> Suspend fails on a system in fips mode because md5 is used for the e820
> integrity check and is not available. Use crc32 instead.
>
> Prior to this patch, MD5 is used only to create a digest to ensure integrity of
> the region, no actual encryption is done. This patch set changes the integrity
> check to use crc32 instead of md5 since crc32 is available in both FIPS and
> non-FIPS modes.
>
> Note that the digest is only used as an integrity check. No actual encryption
> is done.
>
> Fixes: 62a03defeabd ("PM / hibernate: Verify the consistent of e820 memory map
> by md5 digest")
>
> Tested-by: Dexuan Cui <decui@xxxxxxxxxxxxx>
> Reviewed-by: Dexuan Cui <decui@xxxxxxxxxxxxx>
> Signed-off-by: Chris von Recklinghausen <crecklin@xxxxxxxxxx>

Hi Chris,
I would reword it this way:
----------
This patch(set) changes the integrity check algorithm from md5 to
crc32. This integrity check is used only to verify accidental
corruption of the hybernation data and is not intended as a
cryptographic integrity check.
Md5 is overkill in this case and also disabled in FIPS mode because it
is known to be broken for cryptographic purposes.
----------

HTH,
Simo.

--
Simo Sorce
RHEL Crypto Team
Red Hat, Inc