Re: [PATCH] staging: ks7010: select CRYPTO_HASH/CRYPTO_MICHAEL_MIC

From: Vegard Nossum
Date: Mon Oct 11 2021 - 12:56:31 EST



On 10/11/21 5:37 PM, Greg Kroah-Hartman wrote:
> On Mon, Oct 11, 2021 at 05:29:41PM +0200, Vegard Nossum wrote:
>> Fix the following build/link errors:
>>
>> ld: drivers/staging/ks7010/ks_hostif.o: in function `michael_mic.constprop.0':
>> ks_hostif.c:(.text+0x95b): undefined reference to `crypto_alloc_shash'
>> ld: ks_hostif.c:(.text+0x97a): undefined reference to `crypto_shash_setkey'
>> ld: ks_hostif.c:(.text+0xa13): undefined reference to `crypto_shash_update'
>> ld: ks_hostif.c:(.text+0xa28): undefined reference to `crypto_shash_update'
>> ld: ks_hostif.c:(.text+0xa48): undefined reference to `crypto_shash_finup'
>> ld: ks_hostif.c:(.text+0xa6d): undefined reference to `crypto_destroy_tfm'
>>
>> Signed-off-by: Vegard Nossum <vegard.nossum@xxxxxxxxxx>
>> ---
>> drivers/staging/ks7010/Kconfig | 3 +++
>> 1 file changed, 3 insertions(+)
>
> What commit caused these issues?
>
> thanks,
>
> greg k-h
>

So I found this commit that appears to (attempt to) fix this issue already:

commit 3e5bc68fa596874500e8c718605aa44d5e42a34c
Author: YueHaibing <yuehaibing@xxxxxxxxxx>
Date: Fri Jun 21 15:24:55 2019 +0800

staging: ks7010: Fix build error

when CRYPTO is m and KS7010 is y, building fails:

drivers/staging/ks7010/ks_hostif.o: In function
`michael_mic.constprop.13':
ks_hostif.c:(.text+0x560): undefined reference to `crypto_alloc_shash'
ks_hostif.c:(.text+0x580): undefined reference to `crypto_shash_setkey'
ks_hostif.c:(.text+0x5e0): undefined reference to `crypto_destroy_tfm'
ks_hostif.c:(.text+0x614): undefined reference to `crypto_shash_update'
ks_hostif.c:(.text+0x62c): undefined reference to `crypto_shash_update'
ks_hostif.c:(.text+0x648): undefined reference to `crypto_shash_finup'

Add CRYPTO and CRYPTO_HASH dependencies to fix this.

Reported-by: Hulk Robot <hulkci@xxxxxxxxxx>
Fixes: 8b523f20417d ("staging: ks7010: removed custom Michael MIC
implementation.")
Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

Notes (mainline):
Fixes: 8b523f20417d ("staging: ks7010: removed custom Michael MIC
implementation.") # v5.1-rc1
Lore:
https://lore.kernel.org/r/20190621034221.36708-1-yuehaibing@xxxxxxxxxx #
driverdev-devel, lkml

However, it was reverted in v5.2-rc6:

commit a4961427e74948ced9ddd40f3efb2a206b87e4c8
Author: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
Date: Mon Jun 24 16:45:34 2019 +0800

Revert "staging: ks7010: Fix build error"

This reverts commit 3e5bc68fa596874500e8c718605aa44d5e42a34c as it
causes build errors in linux-next.

Reported-by: Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>
Cc: YueHaibing <yuehaibing@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>

Looks like this was the build error in question:

https://lore.kernel.org/all/20190624173855.3c188955@xxxxxxxxxxxxxxxx/

To be honest I don't really see what the full recursive dependency cycle
is, but I think "select" should work instead -- Arnd?

Maybe we can add this:

Fixes: 8b523f20417d ("staging: ks7010: removed custom Michael MIC
implementation.")
Fixes: 3e5bc68fa5968 ("staging: ks7010: Fix build error")
Fixes: a4961427e7494 ("Revert "staging: ks7010: Fix build error"")


Vegard