From: Herbert Xu Subject: Re: Remaining crypto API regressions with CONFIG_VMAP_STACK Date: Wed, 14 Dec 2016 12:56:14 +0800 Message-ID: <20161214045614.GB9592@gondor.apana.org.au> References: <20161209230851.GB64048@google.com> <20161213033928.GB5601@gondor.apana.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Eric Biggers , linux-crypto@vger.kernel.org, "linux-kernel@vger.kernel.org" , "linux-mm@kvack.org" , "kernel-hardening@lists.openwall.com" , Andrew Lutomirski , Stephan Mueller To: Andy Lutomirski Return-path: Received: from helcar.hengli.com.au ([209.40.204.226]:39608 "EHLO helcar.apana.org.au" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754684AbcLNE41 (ORCPT ); Tue, 13 Dec 2016 23:56:27 -0500 Content-Disposition: inline In-Reply-To: Sender: linux-crypto-owner@vger.kernel.org List-ID: On Tue, Dec 13, 2016 at 09:06:31AM -0800, Andy Lutomirski wrote: > > > Having 0 as type and CRYPTO_ALG_ASYNC as mask in general means > > that we're requesting a sync algorithm (i.e., ASYNC bit off). > > > > However, it is completely unnecessary for shash as they can never > > be async. So this could be changed to just ("michael_mic", 0, 0). > > I'm confused by a bunch of this. > > 1. Is it really the case that crypto_alloc_xyz(..., CRYPTO_ALG_ASYNC) > means to allocate a *synchronous* transform? That's not what I > expected. crypto_alloc_xyz(name, 0, CRYPTO_ALG_ASYNC) allocates a sync tfm and crypto_alloc_xyz(name, CRYPTO_ALG_ASYNC, CRYPTO_ALG_ASYNC) allocates an async tfm while crypto_alloc_xyz(name, 0, 0) does not care whether the allocated tfm is sync or asnc. > 2. What guarantees that an async request is never allocated on the > stack? If it's just convention, could an assertion be added > somewhere? Sure we can add an assertion. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt