mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: T Pratham <t-pratham@ti.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
	Manorit Chawdhry <m-chawdhry@ti.com>,
	Shiva Tripathi <s-tripathi1@ti.com>,
	Kamlesh Gurudasani <kamlesh@ti.com>
Subject: Re: [BUG] crypto: tcrypt - data corruption in ahash tests with CRYPTO_AHASH_ALG_BLOCK_ONLY
Date: Fri, 16 Jan 2026 10:30:09 +0800	[thread overview]
Message-ID: <aWmisYTEC07wOO2i@gondor.apana.org.au> (raw)
In-Reply-To: <70710115-6bde-465b-91f2-a005bede1602@ti.com>

On Thu, Jan 15, 2026 at 03:38:50PM +0530, T Pratham wrote:
>
> However, in tcrypt, the wait struct is accessed as below:
> 
> crypto/tcrypt.c:
> static inline int do_one_ahash_op(struct ahash_request *req, int ret)
> {
> 	struct crypto_wait *wait = req->base.data;

This is just broken.  Even before the partial hash block handling
there are code paths where req->base.data will be modified prior
to final return.  That's why the completion function takes a void *
instead of just passing the request back.

So we should fix tcrypt to not do this crazy thing.

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-01-16  2:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15 10:08 T Pratham
2026-01-16  2:30 ` Herbert Xu [this message]
2026-01-16  8:33   ` T Pratham

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=aWmisYTEC07wOO2i@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=davem@davemloft.net \
    --cc=kamlesh@ti.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m-chawdhry@ti.com \
    --cc=s-tripathi1@ti.com \
    --cc=t-pratham@ti.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®