Skip to content

Commit 9c1a774

Browse files
committed
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6: crypto: ixp4xx - Fix qmgr_request_queue build failure crypto: api - Fix module load deadlock with fallback algorithms
2 parents 219f170 + 1777f1a commit 9c1a774

File tree

5 files changed

+21
-8
lines changed

5 files changed

+21
-8
lines changed

arch/s390/crypto/aes_s390.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,7 @@ static void __exit aes_s390_fini(void)
556556
module_init(aes_s390_init);
557557
module_exit(aes_s390_fini);
558558

559-
MODULE_ALIAS("aes");
559+
MODULE_ALIAS("aes-all");
560560

561561
MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm");
562562
MODULE_LICENSE("GPL");

crypto/api.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,19 @@ struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask)
215215
mask &= ~(CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD);
216216
type &= mask;
217217

218-
alg = try_then_request_module(crypto_alg_lookup(name, type, mask),
219-
name);
218+
alg = crypto_alg_lookup(name, type, mask);
219+
if (!alg) {
220+
char tmp[CRYPTO_MAX_ALG_NAME];
221+
222+
request_module(name);
223+
224+
if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask) &&
225+
snprintf(tmp, sizeof(tmp), "%s-all", name) < sizeof(tmp))
226+
request_module(tmp);
227+
228+
alg = crypto_alg_lookup(name, type, mask);
229+
}
230+
220231
if (alg)
221232
return crypto_is_larval(alg) ? crypto_larval_wait(alg) : alg;
222233

drivers/crypto/ixp4xx_crypto.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -457,10 +457,12 @@ static int init_ixp_crypto(void)
457457
if (!ctx_pool) {
458458
goto err;
459459
}
460-
ret = qmgr_request_queue(SEND_QID, NPE_QLEN_TOTAL, 0, 0);
460+
ret = qmgr_request_queue(SEND_QID, NPE_QLEN_TOTAL, 0, 0,
461+
"ixp_crypto:out", NULL);
461462
if (ret)
462463
goto err;
463-
ret = qmgr_request_queue(RECV_QID, NPE_QLEN, 0, 0);
464+
ret = qmgr_request_queue(RECV_QID, NPE_QLEN, 0, 0,
465+
"ixp_crypto:in", NULL);
464466
if (ret) {
465467
qmgr_release_queue(SEND_QID);
466468
goto err;

drivers/crypto/padlock-aes.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -489,4 +489,4 @@ MODULE_DESCRIPTION("VIA PadLock AES algorithm support");
489489
MODULE_LICENSE("GPL");
490490
MODULE_AUTHOR("Michal Ludvig");
491491

492-
MODULE_ALIAS("aes");
492+
MODULE_ALIAS("aes-all");

drivers/crypto/padlock-sha.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ MODULE_DESCRIPTION("VIA PadLock SHA1/SHA256 algorithms support.");
304304
MODULE_LICENSE("GPL");
305305
MODULE_AUTHOR("Michal Ludvig");
306306

307-
MODULE_ALIAS("sha1");
308-
MODULE_ALIAS("sha256");
307+
MODULE_ALIAS("sha1-all");
308+
MODULE_ALIAS("sha256-all");
309309
MODULE_ALIAS("sha1-padlock");
310310
MODULE_ALIAS("sha256-padlock");

0 commit comments

Comments
 (0)