Re: Bug somewhere in crypto or ipsec stuff

From: YOSHIFUJI Hideaki / 吉藤英明
Date: Wed Oct 29 2003 - 22:19:38 EST


In article <16288.30574.745348.194005@xxxxxxxxxxxxxxxxxxxx> (at Thu, 30 Oct 2003 13:29:02 +1100), Paul Mackerras <paulus@xxxxxxxxx> says:

> I get this oops in strcmp, called from crypto_alg_lookup, when I run
> the "spi" command from a freeswan snapshot from 13 October this year.
> The kernel is 2.6.0-test9.
>
> Oops: kernel access of bad area, sig: 11 [#1]
:
> Call trace:
> [c00cf058] crypto_alloc_tfm+0x1c/0x104
> [cd97fb34] ipcomp_init_state+0x90/0x118 [ipcomp]
:

> The problem is basically that crypto_alg_lookup gets called with NULL
> for the `name' parameter.

I would just disallow name == NULL,
well, what algorithm do you expect?

===== crypto/api.c 1.30 vs edited =====
--- 1.30/crypto/api.c Sat Mar 29 20:16:58 2003
+++ edited/crypto/api.c Thu Oct 30 12:07:43 2003
@@ -36,6 +36,9 @@
struct crypto_alg *crypto_alg_lookup(const char *name)
{
struct crypto_alg *q, *alg = NULL;
+
+ if (!name)
+ return NULL;

down_read(&crypto_alg_sem);



--
Hideaki YOSHIFUJI @ USAGI Project <yoshfuji@xxxxxxxxxxxxxx>
GPG FP: 9022 65EB 1ECF 3AD1 0BDF 80D8 4807 F894 E062 0EEA
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/