public inbox for linux-crypto@vger.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vkoul@kernel.org>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: T Pratham <t-pratham@ti.com>,
	"David S. Miller" <davem@davemloft.net>,
	Kamlesh Gurudasani <kamlesh@ti.com>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Praneeth Bajjuri <praneeth@ti.com>,
	Manorit Chawdhry <m-chawdhry@ti.com>,
	linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	dmaengine@vger.kernel.org
Subject: Re: [PATCH v5 2/2] crypto: ti: Add driver for DTHE V2 AES Engine (ECB, CBC)
Date: Wed, 18 Jun 2025 23:23:50 +0530	[thread overview]
Message-ID: <aFL9LsQQdG3WTjUD@vaman> (raw)
In-Reply-To: <aElSKF88vBsIOJMV@gondor.apana.org.au>

On 11-06-25, 17:53, Herbert Xu wrote:
> On Tue, Jun 03, 2025 at 06:07:29PM +0530, T Pratham wrote:
> >
> > +	// Need to do a timeout to ensure finalise gets called if DMA callback fails for any reason
> > +	ret = wait_for_completion_timeout(&rctx->aes_compl, msecs_to_jiffies(DTHE_DMA_TIMEOUT_MS));
> 
> This doesn't look safe.  What if the callback is invoked after a
> timeout? That would be a UAF.
> 
> Does the DMA engine provide any timeout mechanism? If not, then
> you could do it with a delayed work struct.  Just make sure that
> you cancel the work struct in the normal path callback.  Vice versa
> you need to terminate the DMA job in the timeout work struct.

Typically no. Most of the hardware may not have capability, so we have
apis to terminate.

-- 
~Vinod

  parent reply	other threads:[~2025-06-18 17:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-03 12:37 [PATCH v5 0/2] Add support for Texas Instruments DTHE V2 crypto accelerator T Pratham
2025-06-03 12:37 ` [PATCH v5 1/2] dt-bindings: crypto: Add binding for TI DTHE V2 T Pratham
2025-06-03 12:37 ` [PATCH v5 2/2] crypto: ti: Add driver for DTHE V2 AES Engine (ECB, CBC) T Pratham
2025-06-11  9:31   ` Herbert Xu
2025-06-11  9:32   ` Herbert Xu
2025-06-12  5:49     ` T Pratham
2025-06-11  9:53   ` Herbert Xu
2025-06-12 10:15     ` T Pratham
2025-06-16  2:49       ` Herbert Xu
2025-06-18 17:53     ` Vinod Koul [this message]
2025-06-17  4:27 ` [PATCH v5 0/2] Add support for Texas Instruments DTHE V2 crypto accelerator Eric Biggers
2025-06-18 10:30   ` Kamlesh Gurudasani
2025-06-18 17:58     ` Eric Biggers
2025-06-26 13:33       ` Kamlesh Gurudasani
2025-06-26 18:35         ` Eric Biggers
2025-06-20  3:07   ` Simon Richter

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=aFL9LsQQdG3WTjUD@vaman \
    --to=vkoul@kernel.org \
    --cc=davem@davemloft.net \
    --cc=dmaengine@vger.kernel.org \
    --cc=herbert@gondor.apana.org.au \
    --cc=kamlesh@ti.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m-chawdhry@ti.com \
    --cc=praneeth@ti.com \
    --cc=t-pratham@ti.com \
    --cc=vigneshr@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