netdev
[Top] [All Lists]

Re: Bug somewhere in crypto or ipsec stuff

To: paulus@xxxxxxxxx
Subject: Re: Bug somewhere in crypto or ipsec stuff
From: YOSHIFUJI Hideaki / 吉藤英明 <yoshfuji@xxxxxxxxxxxxxx>
Date: Thu, 30 Oct 2003 12:17:32 +0900 (JST)
Cc: linux-kernel@xxxxxxxxxxxxxxx, netdev@xxxxxxxxxxx, davem@xxxxxxxxxx, jmorris@xxxxxxxxxx
In-reply-to: <16288.30574.745348.194005@cargo.ozlabs.ibm.com>
Organization: USAGI Project
References: <16288.30574.745348.194005@cargo.ozlabs.ibm.com>
Sender: netdev-bounce@xxxxxxxxxxx
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

<Prev in Thread] Current Thread [Next in Thread>