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]
Date:	Thu, 15 Jan 2009 20:23:14 +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-kernel@...r.kernel.org>,
	"linux-crypto@...r.kernel.org" <linux-crypto@...r.kernel.org>
Subject: Re: [PATCH crypto -v4 1/2] AES-NI: Add support to access underlying
	blkcipher under cryptd ablkcipher

On Thu, Jan 15, 2009 at 05:21:47PM +0800, Huang Ying wrote:
> On Thu, 2009-01-15 at 16:47 +0800, Herbert Xu wrote:
> > On Thu, Jan 15, 2009 at 04:28:33PM +0800, Huang Ying wrote:
> > >
> > > +	tfm = crypto_alloc_ablkcipher(cryptd_alg_name, type, mask);
> > > +	BUG_ON(crypto_ablkcipher_tfm(tfm)->__crt_alg->cra_module !=
> > > +	       THIS_MODULE);
> > 
> > You need to check whether tfm is an error before dereferencing it.
> > Also it's probably better to free the tfm and return an error rather
> > than invoking BUG.
> 
> Why do we need this check? Someone else may register cryptd template?
> Which error number should be return? -EINVAL?

-ENOMEM for example.

Cheers,
-- 
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