All of lore.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: Fabrizio Demaria <fabrizio.f.demaria@gmail.com>
Cc: linux-crypto@vger.kernel.org, "Nordell,
	Joakim" <joakim.nordell@intel.com>,
	"Chen, Shujuan" <shujuan.chen@intel.com>,
	doru.gucea@intel.com
Subject: Re: "crypto_hash_setkey" call from atomic context
Date: Mon, 14 Dec 2015 17:57:00 +0800	[thread overview]
Message-ID: <20151214095700.GA32274@gondor.apana.org.au> (raw)
In-Reply-To: <CACzeOEfOSi7T2CmE1HjU-ryCGEBj-b0h2E-o0BrmKWiFvMcEHQ@mail.gmail.com>

On Mon, Dec 14, 2015 at 09:53:03AM +0100, Fabrizio Demaria wrote:
> In our MPTCP implementation we handled the setkey problem by
> pre-allocating a properly aligned key's buffer right after
> "crypto_alloc_hash", outside atomic context [1]. Would this workaround
> be enough to guarantee that "crypto_hash_setkey" can be safely called
> in atomic contexts? Is it always the case that "crypto_hash_setkey"
> calls "crypto_shash_setkey"?

First of all don't use crypto_hash_* in new code.  It is obsolete.
Instead use shash or ahash as appropirate.

The proper way to manage keys is to set them when you allocate the
tfm.  You should use a different tfm for each key.

Cheers,
-- 
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:[~2015-12-14  9:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-10 15:59 "crypto_hash_setkey" call from atomic context Fabrizio Demaria
2015-12-11  7:42 ` Herbert Xu
2015-12-14  8:53   ` Fabrizio Demaria
2015-12-14  9:57     ` Herbert Xu [this message]

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=20151214095700.GA32274@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=doru.gucea@intel.com \
    --cc=fabrizio.f.demaria@gmail.com \
    --cc=joakim.nordell@intel.com \
    --cc=linux-crypto@vger.kernel.org \
    --cc=shujuan.chen@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.