Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Christian Hohnstaedt <christian@hohnstaedt.de>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Crypto Mailing List <linux-crypto@vger.kernel.org>
Subject: [PATCH] crypto: fix larval lookup
Date: Mon, 18 Aug 2008 09:02:04 +0200	[thread overview]
Message-ID: <20080818070204.GL22567@mail3.prorata.de> (raw)


crypto_alg_mod_lookup() runs in a timeout (60s) for unknown algos.

crypto_larval_error() doesn't find the larval and thus doesn't
finish crypto_larval_wait, because
the larval->mask has the CRYPTO_ALG_TESTED bit set, while
crypto_alg_lookup() is called without that bit in the mask
and the mask comparison in __crypto_alg_lookup fails.

Since larvals itself never get tested, it seems ok to 
reset that bit.

Signed-off-by: Christian Hohnstaedt <chohnstaedt@innominate.com>
---
 crypto/api.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/crypto/api.c b/crypto/api.c
index cd232d4..0a4012e 100644
--- a/crypto/api.c
+++ b/crypto/api.c
@@ -118,7 +118,7 @@ struct crypto_larval *crypto_larval_alloc(const char *name, u32 type, u32 mask)
 	if (!larval)
 		return ERR_PTR(-ENOMEM);
 
-	larval->mask = mask;
+	larval->mask = mask & ~CRYPTO_ALG_TESTED;
 	larval->alg.cra_flags = CRYPTO_ALG_LARVAL | type;
 	larval->alg.cra_priority = -1;
 	larval->alg.cra_destroy = crypto_larval_destroy;
-- 
1.5.6.3


             reply	other threads:[~2008-08-18  7:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-18  7:02 Christian Hohnstaedt [this message]
2008-08-19  5:05 ` [PATCH] crypto: fix larval lookup Herbert Xu

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=20080818070204.GL22567@mail3.prorata.de \
    --to=christian@hohnstaedt.de \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@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