Skip to content

Commit

Permalink
crypto: api - Fix algorithm module auto-loading
Browse files Browse the repository at this point in the history
The commit a760a66 (crypto:
api - Fix module load deadlock with fallback algorithms) broke
the auto-loading of algorithms that require fallbacks.  The
problem is that the fallback mask check is missing an and which
cauess bits that should be considered to interfere with the
result.

Reported-by: Chuck Ebbert <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed Apr 21, 2009
1 parent abe5fa7 commit 37fc334
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crypto/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask)

request_module(name);

if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask) &&
if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask &
CRYPTO_ALG_NEED_FALLBACK) &&
snprintf(tmp, sizeof(tmp), "%s-all", name) < sizeof(tmp))
request_module(tmp);

Expand Down

0 comments on commit 37fc334

Please sign in to comment.