Thread (45 messages) 45 messages, 6 authors, 2007-10-08

Re: [PATCH] [crypto] load the SHA1[1|256] module by an alias (v2)

From: Herbert Xu <herbert@gondor.apana.org.au>
Date: 2007-10-05 15:10:54

On Fri, Oct 05, 2007 at 03:12:10PM +0200, Sebastian Siewior wrote:
Loading the crypto algorithm by the alias instead of by module directly
has the advantage that all possible implementations of this algorithm
are loaded automatically and the crypto API can choose the best one
depending on its priority.
Additionally it ensures that the generic implementation as well as the
HW driver (if available) is loaded in case the HW driver needs the
generic version as fallback in corner cases.
Also remove the probe for sha1 in padlock's init code.
Quote from Herbert:
  The probe is actually pointless since we can always probe when
  the algorithm is actually used which does not lead to dead-locks
  like this.
Thanks.  I'll apply this tomorrow.

BTW, the dead-lock does exist after all.  The lock that's held
is the user-space file lock held by modprobe.  Assuming that
padlock-sha comes before sha in the alias list, then the second
modprobe will hit padlock-sha again and dead-lock.

Cheers,
-- 
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} [off-list ref]
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help