mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
Cc: Thara Gopinath <thara.gopinath@gmail.com>,
	Herbert Xu <herbert@gondor.apana.org.au>,
	"David S. Miller" <davem@davemloft.net>,
	Stanimir Varbanov <svarbanov@mm-sol.com>,
	Eneas U de Queiroz <cotequeiroz@gmail.com>,
	Kuldeep Singh <kuldeep.singh@oss.qualcomm.com>,
	linux-crypto@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-kernel@vger.kernel.org, brgl@kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH v6 1/8] crypto: qce - Fix HMAC self-test failures for empty messages
Date: Thu, 23 Jul 2026 12:25:14 -0700	[thread overview]
Message-ID: <20260723192514.GA110634@quark> (raw)
In-Reply-To: <20260717-qce-fix-self-tests-v6-1-455775fe5f6c@oss.qualcomm.com>

On Fri, Jul 17, 2026 at 05:53:30PM +0200, Bartosz Golaszewski wrote:
> +/*
> + * BAM DMA cannot handle zero-length transfers, so the driver always holds
> + * back at least one byte to submit to the engine. A zero rctx->buflen at
> + * finalization time does not necessarily mean the message is empty: the
> + * caller may have imported a state that already reflects some hashed data
> + * with nothing currently buffered. Handle both cases through the software
> + * fallback: reconstruct the running state when there is one instead of
> + * assuming the message is empty.
> + */
> +static int qce_ahash_finalize_zero(struct ahash_request *req)
> +{
> +	struct qce_sha_reqctx *rctx = ahash_request_ctx_dma(req);
> +	HASH_FBREQ_ON_STACK(fbreq, req);

I'm trying to understand how this is intended to work.  This uses
crypto_tfm::fb.  But this driver doesn't set CRYPTO_ALG_NEED_FALLBACK,
so crypto_tfm::fb is actually just a pointer to the same crypto_tfm.
(See crypto_create_tfm_node() and crypto_ahash_init_tfm().)  Doesn't
this just result in an infinite recursive loop and a crash?

- Eric

  reply	other threads:[~2026-07-23 19:25 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17 15:53 [PATCH v6 0/8] crypto: qce - Fix crypto self-test failures Bartosz Golaszewski
2026-07-17 15:53 ` [PATCH v6 1/8] crypto: qce - Fix HMAC self-test failures for empty messages Bartosz Golaszewski
2026-07-23 19:25   ` Eric Biggers [this message]
2026-07-26 23:08     ` Herbert Xu
2026-07-30  8:53       ` Bartosz Golaszewski
2026-07-17 15:53 ` [PATCH v6 2/8] crypto: qce - Reject empty messages for AES-XTS Bartosz Golaszewski
2026-07-17 15:53 ` [PATCH v6 3/8] crypto: qce - Fix CTR-AES for partial block requests Bartosz Golaszewski
2026-07-17 15:53 ` [PATCH v6 4/8] crypto: qce - Use a fallback for AES-CTR with a partial final block Bartosz Golaszewski
2026-07-17 15:53 ` [PATCH v6 5/8] crypto: qce - Use fallback for fragmented skcipher payloads Bartosz Golaszewski
2026-07-17 15:53 ` [PATCH v6 6/8] crypto: qce - Fix xts-aes-qce for weak keys Bartosz Golaszewski
2026-07-17 15:53 ` [PATCH v6 7/8] crypto: qce - Use a fallback for CCM with a partial final block Bartosz Golaszewski
2026-07-23 18:34   ` Eric Biggers
2026-07-17 15:53 ` [PATCH v6 8/8] crypto: qce - Use fallback for CCM with a fragmented payload Bartosz Golaszewski
2026-07-23 20:27 ` [PATCH v6 0/8] crypto: qce - Fix crypto self-test failures Eric Biggers
2026-07-23 20:53   ` Eric Biggers

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=20260723192514.GA110634@quark \
    --to=ebiggers@kernel.org \
    --cc=bartosz.golaszewski@oss.qualcomm.com \
    --cc=brgl@kernel.org \
    --cc=cotequeiroz@gmail.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=kuldeep.singh@oss.qualcomm.com \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=svarbanov@mm-sol.com \
    --cc=thara.gopinath@gmail.com \
    /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®