Re: [PATCH/proposal] dm-crypt: add digest-based iv generation mode

From: James Morris
Date: Tue Feb 24 2004 - 17:51:11 EST


On Tue, 24 Feb 2004, Christophe Saout wrote:

> Am Di, den 24.02.2004 schrieb James Morris um 23:26:
>
> > > BTW: I think there's a bug in the ipv6 code, it uses spin_lock to
> > > protect itself, this will cause a sleep-inside-spinlock warning. (found
> > > while grepping through the source for other cryptoapi users)
> >
> > Where is the bug?
>
> net/ipv6/addrconf.c: __ipv6_regen_rndid
>
> > spin_lock(&md5_tfm_lock);
> > if (unlikely(md5_tfm == NULL)) {
> > spin_unlock(&md5_tfm_lock);
> > return -1;
> > }
> > crypto_digest_init(md5_tfm);
> > crypto_digest_update(md5_tfm, sg, 2);
> > crypto_digest_final(md5_tfm, idev->work_digest);
> > spin_unlock(&md5_tfm_lock);

This looks like too much work to be done under a spinlock, and generally,
that's why the API does not support these kinds of functions from being
called under one.


- James
--
James Morris
<jmorris@xxxxxxxxxx>



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/