On Thu, Nov 22, 2007 at 02:17:11PM +0300, Evgeniy Polyakov wrote: > > > + spin_lock_bh(&ctx->lock); > > Crypto hardware can access iv in interrupt context and thus this can get > wrong data. This lock only guards against other callers of this function. It doesn't care about how you do the underlying encryption. You can do it in softirq context, hardirq context, or offload it to the moon :) > Are you sure that crypto operation has to be limited to be performed > with turned off bottom halves? I believe this is a huge limitation for > those ablkcipher devices which are not async actually... This only applies to givcrypt which is only used by IPsec where we already do everything under a bh lock :) New users should specify the IV generator explicitly as is done in dm-crypt. In any case, this (the choice of chainiv as the default for sync blkcipher) is something that we can change pretty easily down the track without affecting anything else. Cheers, -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <herbert@xxxxxxxxxxxxxxxxxxx> 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-crypto" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html