Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754107AbdFWIce (ORCPT ); Fri, 23 Jun 2017 04:32:34 -0400 Received: from orcrist.hmeau.com ([104.223.48.154]:35984 "EHLO deadmen.hmeau.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751217AbdFWIcc (ORCPT ); Fri, 23 Jun 2017 04:32:32 -0400 Date: Fri, 23 Jun 2017 16:32:00 +0800 From: Herbert Xu To: Megha Dey Cc: tim.c.chen@linux.intel.com, davem@davemloft.net, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [Patch V5 1/7] crypto: Multi-buffer encryption infrastructure support Message-ID: <20170623083200.GA29882@gondor.apana.org.au> References: <1492721440-3698-1-git-send-email-megha.dey@linux.intel.com> <1492721440-3698-2-git-send-email-megha.dey@linux.intel.com> <20170424090024.GA20535@gondor.apana.org.au> <1496951574.8042.15.camel@megha-Z97X-UD7-TH> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1496951574.8042.15.camel@megha-Z97X-UD7-TH> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1361 Lines: 41 On Thu, Jun 08, 2017 at 12:52:54PM -0700, Megha Dey wrote: > > I will move this code to the mcryptd.c. > > About the naming scheme, could you give me an example where the internal > and external algorithm have the same name? I tried searching but did not > find any. > > When the outer and inner algorithm have the same name, I see a crash > when testing using tcrypt. This is because the wrong algortihm (with a > higher priority) is being picked up in __crypto_alg_lookup. > > Inner alg: > Currently: > alg name:__cbc(aes), driver name:__cbc-aes-aesni-mb > > expected: > alg name:cbc(aes), driver name: cbc-aes-aesni-mb > > Outer alg: > Currently: > alg name:cbc(aes), driver name:cbc-aes-aesni-mb > > expected: > alg name:cbc(aes), driver name:mcryptd-cbc-aes-aesni-mb This all looks right. So I'm not sure why you're getting the crash. We're relying on the INTERNAL flag to ensure the internal algorithm is not picked up except when we strictly ask for it. In fact I see something fishy in your testmgr code (the last patch in the series I think). It's setting the INTERNAL bit when allocating tfms, that does not look right. The only one that should be setting this is mcryptd. Cheers, -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt