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] [day] [month] [year] [list]
Message-ID: <20090116071203.GA12661@gondor.apana.org.au>
Date:	Fri, 16 Jan 2009 18:12:04 +1100
From:	Herbert Xu <herbert@...dor.apana.org.au>
To:	Huang Ying <ying.huang@...el.com>
Cc:	Sebastian Siewior <linux-crypto@...breakpoint.cc>,
	linux-kernel@...r.kernel.org, linux-crypto@...r.kernel.org
Subject: Re: [PATCH crypto -v5 1/2] AES-NI: Add support to access
	underlying blkcipher under cryptd ablkcipher

On Fri, Jan 16, 2009 at 03:10:20PM +0800, Huang Ying wrote:
>
> v5:
> 
> - Move declaration to crypto/cryptd.h
> 
> - Fix allocation error processing in cryptd_alloc_ablkcipher()
> 
> Signed-off-by: Huang Ying <ying.huang@...el.com>

OK we're nearly there :)

> +struct cryptd_ablkcipher *cryptd_alloc_ablkcipher(const char *alg_name,
> +						  u32 type, u32 mask)
> +{
> +	char cryptd_alg_name[CRYPTO_MAX_ALG_NAME];
> +	struct crypto_ablkcipher *tfm;
> +
> +	if (snprintf(cryptd_alg_name, CRYPTO_MAX_ALG_NAME,
> +		     "cryptd(%s)", alg_name) >= CRYPTO_MAX_ALG_NAME)
> +		return ERR_PTR(-EINVAL);
> +	tfm = crypto_alloc_ablkcipher(cryptd_alg_name, type, mask);
> +	if (IS_ERR(tfm))
> +		return ERR_CAST(tfm);
> +	if (crypto_ablkcipher_tfm(tfm)->__crt_alg->cra_module != THIS_MODULE)
> +		return ERR_PTR(-EINVAL);

Need to free the tfm here or it'll be leaked.

Thanks,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ