From mboxrd@z Thu Jan 1 00:00:00 1970 From: Herbert Xu Subject: Re: "crypto_hash_setkey" call from atomic context Date: Mon, 14 Dec 2015 17:57:00 +0800 Message-ID: <20151214095700.GA32274@gondor.apana.org.au> References: <20151211074223.GA11688@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-crypto@vger.kernel.org, "Nordell, Joakim" , "Chen, Shujuan" , doru.gucea@intel.com To: Fabrizio Demaria Return-path: Received: from helcar.hengli.com.au ([209.40.204.226]:36955 "EHLO helcar.hengli.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932127AbbLNJ5V (ORCPT ); Mon, 14 Dec 2015 04:57:21 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-crypto-owner@vger.kernel.org List-ID: 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 Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt