Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Dmitry Safonov <dima@arista.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>,
	linux-kernel@vger.kernel.org, Bob Gilligan <gilligan@arista.com>,
	David Ahern <dsahern@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Dmitry Safonov <0x7f454c46@gmail.com>,
	Eric Dumazet <edumazet@google.com>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	Francesco Ruggeri <fruggeri05@gmail.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Salam Noureddine <noureddine@arista.com>,
	linux-crypto@vger.kernel.org
Subject: Re: [PATCH-next 2/3] crypto: api - Provide gfp mask for tfm allocation
Date: Thu, 15 Jun 2023 16:38:49 -0700	[thread overview]
Message-ID: <20230615233849.GB25295@sol.localdomain> (raw)
In-Reply-To: <20230614174643.3836590-3-dima@arista.com>

On Wed, Jun 14, 2023 at 06:46:42PM +0100, Dmitry Safonov wrote:
> diff --git a/crypto/cipher.c b/crypto/cipher.c
> index d39ef5f72ab8..184188339a4a 100644
> --- a/crypto/cipher.c
> +++ b/crypto/cipher.c
> @@ -102,7 +102,7 @@ struct crypto_cipher *crypto_clone_cipher(struct crypto_cipher *cipher)
>  		return ERR_PTR(-ENOSYS);
>  
>  	ntfm = __crypto_alloc_tfm(alg, CRYPTO_ALG_TYPE_CIPHER,
> -				  CRYPTO_ALG_TYPE_MASK);
> +				  CRYPTO_ALG_TYPE_MASK, GFP_ATOMIC);
>  	if (IS_ERR(ntfm))
>  		return ERR_CAST(ntfm);
>  

Should crypto_clone_cipher() not have a gfp_t argument itself?

I'm wondering if any users of the crypto_clone_*() functions will need anything
other than GFP_ATOMIC, such as GFP_NOFS or GFP_NOIO.

FWIW, btrfs's support for fscrypt is planned to use per-extent keys.  It's
challenging to implement.  I've been thinking it might need a
crypto_clone_skcipher() function that it can use during filesystem I/O.  That
use case would want GFP_NOFS, I think.

- Eric

  parent reply	other threads:[~2023-06-15 23:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-14 17:46 [PATCH-next 0/3] crypto: cmac - clone fixes Dmitry Safonov
2023-06-14 17:46 ` [PATCH-next 1/3] crypto: api - Remove crypto_init_ops() Dmitry Safonov
2023-06-15 23:31   ` Eric Biggers
2023-06-14 17:46 ` [PATCH-next 2/3] crypto: api - Provide gfp mask for tfm allocation Dmitry Safonov
2023-06-15  9:00   ` [v2 PATCH] crypto: api - Add __crypto_alloc_tfmgfp Herbert Xu
2023-06-15 16:19     ` Dmitry Safonov
2023-06-20 16:59       ` Dmitry Safonov
2023-06-15 23:38   ` Eric Biggers [this message]
2023-06-16  0:25     ` [PATCH-next 2/3] crypto: api - Provide gfp mask for tfm allocation Herbert Xu
2023-06-14 17:46 ` [PATCH-next 3/3] crypto: cipher - On clone do crypto_mod_get() Dmitry Safonov
2023-06-23  8:23 ` [PATCH-next 0/3] crypto: cmac - clone fixes Herbert Xu

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=20230615233849.GB25295@sol.localdomain \
    --to=ebiggers@kernel.org \
    --cc=0x7f454c46@gmail.com \
    --cc=davem@davemloft.net \
    --cc=dima@arista.com \
    --cc=dsahern@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=edumazet@google.com \
    --cc=fruggeri05@gmail.com \
    --cc=gilligan@arista.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=kuba@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=noureddine@arista.com \
    --cc=pabeni@redhat.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