Re: [PATCH] crypto: caam - remove HMAC key hex dumps from hash_digest_key
From: Thorsten Blum
Date: Tue Mar 17 2026 - 07:23:04 EST
On Sat, Mar 14, 2026 at 01:56:25PM +0900, Herbert Xu wrote:
> On Fri, Mar 06, 2026 at 12:12:03PM +0100, Thorsten Blum wrote:
> > Stop dumping sensitive HMAC key bytes (original and reduced keys) in
> > hash_digest_key() to avoid leaking secrets when debug logging is
> > enabled.
> >
> > Fixes: 045e36780f11 ("crypto: caam - ahash hmac support")
> > Fixes: 3f16f6c9d632 ("crypto: caam/qi2 - add support for ahash algorithms")
> > Cc: stable@xxxxxxxxxxxxxxx
> > Signed-off-by: Thorsten Blum <thorsten.blum@xxxxxxxxx>
> > ---
> > drivers/crypto/caam/caamalg_qi2.c | 5 -----
> > drivers/crypto/caam/caamhash.c | 6 ------
> > 2 files changed, 11 deletions(-)
>
> What is the rationale for this? When debugging is enabled, all
> sorts of things could be dumped, e.g., passwords.
This is not specifically about caam, but (debug) logging of potentially
sensitive key material should generally be avoided, imho. Some other
recent examples:
https://lore.kernel.org/lkml/20260227230008.858641-2-thorsten.blum@xxxxxxxxx/
https://lore.kernel.org/lkml/20260303132552.65235-2-thorsten.blum@xxxxxxxxx/
https://lore.kernel.org/lkml/20260303190350.78705-2-thorsten.blum@xxxxxxxxx/
> Is there a scenario where production systems will run with debugging
> enabled in caam?
I don't know - possibly.
Thanks,
Thorsten