From: "Lee, Chun-Yi" <joeyli.kernel@gmail.com>
To: Herbert Xu <herbert@gondor.apana.org.au>,
"David S. Miller" <davem@davemloft.net>
Cc: linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, "Lee,
Chun-Yi" <jlee@suse.com>
Subject: [PATCH] crypto: avoid module request when lookup crypto larval of template
Date: Mon, 10 Mar 2014 17:22:51 +0800 [thread overview]
Message-ID: <1394443371-12181-1-git-send-email-jlee@suse.com> (raw)
When allocate crypto algorithms, e.g. crypto_alloc_shash(), using
template model will run into the path that call module_request().
But there have no any module alias that match with the template name.
e.g.
Enable the module_request tracing event then run "modprobe tcrypt
mode=10" to test, it produces module_request event:
[...]
modprobe-4965 [000] .... 123.504690: module_request: ecb(aes)
wait=1 call_site=crypto_larval_lookup
modprobe-4965 [002] .... 123.506826: module_request:
ecb(aes)-all wait=1 call_site=crypto_larval_lookup
cryptomgr_probe-4970 [003] .... 123.509007: module_request: ecb
wait=1 call_site=crypto_lookup_template
Here should not call module_request() for ecb(aes) because the template
name doesn't match with any driver's alias.
This patch add the name checking in crypto_larval_lookup() to
filter out the template before request kernel module.
Signed-off-by: Lee, Chun-Yi <jlee@suse.com>
---
crypto/api.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/crypto/api.c b/crypto/api.c
index a2b39c5..9aac892 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -215,7 +215,7 @@ struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask)
type &= mask;
alg = crypto_alg_lookup(name, type, mask);
- if (!alg) {
+ if (!alg && !strchr(name, '(')) {
request_module("%s", name);
if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask &
--
1.6.4.2
next reply other threads:[~2014-03-10 9:23 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-10 9:22 Lee, Chun-Yi [this message]
2014-03-10 11:57 ` Herbert Xu
2014-03-11 14:02 ` joeyli
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1394443371-12181-1-git-send-email-jlee@suse.com \
--to=joeyli.kernel@gmail.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=jlee@suse.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®