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

From: Eric Biggers
Date: Thu Apr 15 2021 - 16:09:28 EST


On Thu, Apr 15, 2021 at 03:46:46PM -0400, Chris von Recklinghausen wrote:
> Hibernation fails on a system in fips mode because md5 is used for the e820
> integrity check and is not available. Use crc32 instead.
>
> This patch changes the integrity check algorithm from md5 to crc32.

The second paragraph is redundant with the first.

> /**
> - * get_e820_md5 - calculate md5 according to given e820 table
> + * compute_e820_crc32 - calculate md5 according to given e820 table
> *
> * @table: the e820 table to be calculated
> - * @buf: the md5 result to be stored to
> */

This comment still mentions MD5.

Also, this isn't a well-formed kerneldoc comment, since it doesn't document the
return value.

Also, this function is calculating the checksum *of* the table, not calculating
a checksum "according to" it (whatever that means).

Something like this would be good, I think:

/**
* compute_e820_crc32 - compute the CRC-32 of the given e820 table
*
* @table: the e820 table to be checksummed
*
* Return: the resulting checksum
*/

Also, please try 'git grep -i md5 arch/x86/kernel/'. There is still another
reference to MD5 that should be updated, in arch/x86/kernel/e820.c.

- Eric