The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: T Pratham <t-pratham@ti.com>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: "David S. Miller" <davem@davemloft.net>,
	Manorit Chawdhry <m-chawdhry@ti.com>,
	Kamlesh Gurudasani <kamlesh@ti.com>,
	Shiva Tripathi <s-tripathi1@ti.com>,
	Kavitha Malarvizhi <k-malarvizhi@ti.com>,
	"Vishal Mahaveer" <vishalm@ti.com>,
	Praneeth Bajjuri <praneeth@ti.com>,
	<linux-crypto@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 2/4] crypto: ti - Add support for AES-CTR in DTHEv2 driver
Date: Thu, 6 Nov 2025 13:55:40 +0530	[thread overview]
Message-ID: <afabae10-95fa-43c2-8929-c6d8164a56f2@ti.com> (raw)
In-Reply-To: <aQxM2z9kC6sTqBZ5@gondor.apana.org.au>

On 06/11/25 12:53, Herbert Xu wrote:
> On Fri, Oct 31, 2025 at 08:11:34PM +0530, T Pratham wrote:
>>
>> Let me know if this is fine.
> 
> Yes I think this should work.
> 
>> However, I suppose we similarly cannot do allocations in AEADs as well?
>> If that is the case, my current code relies a lot on it (using sg_split
>> to separate AAD from {plain, cipher}text and applying padding like CTR
>> here, both of which allocate memory).
>>
>> I can change padding to avoid kmallocs like CTR easily. But separating
>> AAD and plaintext/ciphertext without using sg_split will be a task. Let
>> me know if this is correct, so that I'll split the series and send
>> ciphers now, and AEADs later.
> 
> OK it's not totally forbidden to allocate memory.  However, you
> should only use GFP_ATOMIC to avoid dead-lock (GFP_KERNEL can
> trigger writes to storage, which can in turn call crypto), and
> provide a fallback path to software crypto when the allocation
> fails.
> 
> Cheers,

Understood. Thanks for the insights. I'll re-spin the series with
necessary changes.

-- 
Regards
T Pratham <t-pratham@ti.com>

  reply	other threads:[~2025-11-06  8:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-22 17:45 [PATCH v5 0/4] Add support for more AES modes in TI DTHEv2 T Pratham
2025-10-22 17:45 ` [PATCH v5 1/4] crypto: ti - Add support for AES-XTS in DTHEv2 driver T Pratham
2025-10-22 17:45 ` [PATCH v5 2/4] crypto: ti - Add support for AES-CTR " T Pratham
2025-10-31  9:36   ` Herbert Xu
2025-10-31 14:41     ` T Pratham
2025-11-06  7:23       ` Herbert Xu
2025-11-06  8:25         ` T Pratham [this message]
2025-10-22 17:45 ` [PATCH v5 3/4] crypto: ti - Add support for AES-GCM " T Pratham
2025-10-22 17:45 ` [PATCH v5 4/4] crypto: ti - Add support for AES-CCM " 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=afabae10-95fa-43c2-8929-c6d8164a56f2@ti.com \
    --to=t-pratham@ti.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=k-malarvizhi@ti.com \
    --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=s-tripathi1@ti.com \
    --cc=vishalm@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