lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6779613a.050a0220.184c1c.c90e@mx.google.com>
Date: Sat, 4 Jan 2025 17:26:28 +0100
From: Christian Marangi <ansuelsmth@...il.com>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: "David S. Miller" <davem@...emloft.net>, Rob Herring <robh@...nel.org>,
	Krzysztof Kozlowski <krzk+dt@...nel.org>,
	Conor Dooley <conor+dt@...nel.org>,
	Antoine Tenart <atenart@...nel.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Ingo Molnar <mingo@...hat.com>, Will Deacon <will@...nel.org>,
	Waiman Long <longman@...hat.com>, Boqun Feng <boqun.feng@...il.com>,
	Nathan Chancellor <nathan@...nel.org>,
	Nick Desaulniers <ndesaulniers@...gle.com>,
	Bill Wendling <morbo@...gle.com>,
	Justin Stitt <justinstitt@...gle.com>, linux-crypto@...r.kernel.org,
	devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
	llvm@...ts.linux.dev, upstream@...oha.com,
	Richard van Schagen <vschagen@...oud.com>
Subject: Re: [PATCH v9 3/3] crypto: Add Inside Secure SafeXcel EIP-93 crypto
 engine support

On Sat, Dec 21, 2024 at 07:44:30PM +0800, Herbert Xu wrote:
> On Sat, Dec 14, 2024 at 02:27:54PM +0100, Christian Marangi wrote:
> >
> > +	ahash_tfm = crypto_alloc_ahash(alg_name, 0, 0);
> > +	if (IS_ERR(ahash_tfm))
> > +		return PTR_ERR(ahash_tfm);
> > +
> > +	req = ahash_request_alloc(ahash_tfm, GFP_ATOMIC);
> > +	if (!req) {
> > +		ret = -ENOMEM;
> > +		goto err_ahash;
> > +	}
> > +
> > +	rctx = ahash_request_ctx_dma(req);
> > +	crypto_init_wait(&wait);
> > +	ahash_request_set_callback(req, CRYPTO_TFM_REQ_MAY_BACKLOG,
> > +				   crypto_req_done, &wait);
> > +
> > +	/* Hash the key if > SHA256_BLOCK_SIZE */
> > +	if (keylen > SHA256_BLOCK_SIZE) {
> > +		sg_init_one(&sg[0], key, keylen);
> > +
> > +		ahash_request_set_crypt(req, sg, ipad, keylen);
> > +		ret = crypto_wait_req(crypto_ahash_digest(req), &wait);
> 
> Sleeping in setkey is no longer allowed.  I don't think it's
> fatal yet because the main user driving this currently uses
> sync ahashes only.  But we should avoid this in all new driver
> code.
> 
> Easiest fix would be to allocate a sync ahash:
> 
> 	ahash_tfm = crypto_alloc_ahash(alg_name, 0, CRYPTO_ALG_SYNC);
>

Hi Herbert,

I'm a bit confused by this... I can't find any reference of
CRYPTO_ALG_SYNC, is this something new? Any hint on where to look for
it? Can't find it in include/linux/crypto.h

Following the codeflow of crypto_alloc_ahash is a bit problematic.

-- 
	Ansuel

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ