Re: [PATCH] crypto: octeontx - use crypto_memneq() to check HMAC
From: Herbert Xu
Date: Fri Sep 04 2026 - 06:42:18 EST
On Sat, Aug 15, 2026 at 07:09:14PM +0200, David C.C.M. Gall wrote:
> validate_hmac_cipher_null() compares the computed and received HMAC
> with memcmp(), which short-circuits on the first differing byte and
> leaks tag-match length via timing. Use crypto_memneq() instead.
>
> Because for cipher_null the validated payload is un-encrypted, this
> valid prefix leak allows for authenticated message forgery.
>
> Assisted-by: gregkh_clanker_t1000
> Signed-off-by: David C.C.M. Gall <david.ccm.gall@xxxxxxxxxxxxxx>
> ---
> drivers/crypto/marvell/octeontx/otx_cptvf_algs.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
Patch applied. Thanks.
--
Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt