mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Thorsten Blum <thorsten.blum@linux.dev>
Cc: "Horia Geantă" <horia.geanta@nxp.com>,
	"Pankaj Gupta" <pankaj.gupta@nxp.com>,
	"Gaurav Jain" <gaurav.jain@nxp.com>,
	"David S. Miller" <davem@davemloft.net>,
	"Kim Phillips" <kim.phillips@freescale.com>,
	"Yuan Kang" <Yuan.Kang@freescale.com>,
	stable@vger.kernel.org, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] crypto: caam - guard HMAC key hex dumps in hash_digest_key
Date: Thu, 19 Mar 2026 13:20:35 +0900	[thread overview]
Message-ID: <abt5k85OBr8LGaFe@gondor.apana.org.au> (raw)
In-Reply-To: <20260318194649.137257-3-thorsten.blum@linux.dev>

On Wed, Mar 18, 2026 at 08:46:50PM +0100, Thorsten Blum wrote:
>
> diff --git a/drivers/crypto/caam/caamalg_qi2.c b/drivers/crypto/caam/caamalg_qi2.c
> index 167372936ca7..3392070942ab 100644
> --- a/drivers/crypto/caam/caamalg_qi2.c
> +++ b/drivers/crypto/caam/caamalg_qi2.c
> @@ -3269,8 +3269,10 @@ static int hash_digest_key(struct caam_hash_ctx *ctx, u32 *keylen, u8 *key,
>  	dpaa2_fl_set_addr(out_fle, key_dma);
>  	dpaa2_fl_set_len(out_fle, digestsize);
>  
> -	print_hex_dump_debug("key_in@" __stringify(__LINE__)": ",
> -			     DUMP_PREFIX_ADDRESS, 16, 4, key, *keylen, 1);
> +#ifdef DEBUG
> +	print_hex_dump(KERN_DEBUG, "key_in@" __stringify(__LINE__)": ",
> +		       DUMP_PREFIX_ADDRESS, 16, 4, key, *keylen, 1);
> +#endif

I'd prefer to keep the compiler coverage when DEBUG is off.

Please add a new helper, either print_hex_dump_devel or
print_hex_dump_sensitive that only gets enabled when DEBUG is
defined.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

      reply	other threads:[~2026-03-19  4:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-18 19:46 Thorsten Blum
2026-03-19  4:20 ` Herbert Xu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=abt5k85OBr8LGaFe@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=Yuan.Kang@freescale.com \
    --cc=davem@davemloft.net \
    --cc=gaurav.jain@nxp.com \
    --cc=horia.geanta@nxp.com \
    --cc=kim.phillips@freescale.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pankaj.gupta@nxp.com \
    --cc=stable@vger.kernel.org \
    --cc=thorsten.blum@linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®