Re: Bug somewhere in crypto or ipsec stuff

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



YOSHIFUJI Hideaki / ???? <yoshfuji@linux-ipv6.org> wrote:
> 
> okay. how about this?
> 
> ===== net/ipv4/ipcomp.c 1.16 vs edited =====
> --- 1.16/net/ipv4/ipcomp.c      Mon Aug 18 20:14:38 2003
> +++ edited/net/ipv4/ipcomp.c    Thu Oct 30 14:18:49 2003
> @@ -360,7 +360,12 @@
>        ipcd->scratch = kmalloc(IPCOMP_SCRATCH_SIZE, GFP_KERNEL);
>        if (!ipcd->scratch)
>                goto error;
> -       
> +
> +       if (!x->calg->alg_name) {

This is always false as alg_name is an array.

Please try this patch instead.

Cheers,
-- 
Debian GNU/Linux 3.0 is out! ( http://www.debian.org/ )
Email:  Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
--
Index: kernel-source-2.5/net/ipv4/ah4.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/ipv4/ah4.c,v
retrieving revision 1.4
diff -u -r1.4 ah4.c
--- kernel-source-2.5/net/ipv4/ah4.c	19 Aug 2003 10:10:22 -0000	1.4
+++ kernel-source-2.5/net/ipv4/ah4.c	30 Oct 2003 10:40:42 -0000
@@ -245,6 +245,9 @@
 	struct ah_data *ahp = NULL;
 	struct xfrm_algo_desc *aalg_desc;
 
+	if (!x->aalg)
+		goto error;
+
 	/* null auth can use a zero length key */
 	if (x->aalg->alg_key_len > 512)
 		goto error;
Index: kernel-source-2.5/net/ipv4/ipcomp.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/ipv4/ipcomp.c,v
retrieving revision 1.6
diff -u -r1.6 ipcomp.c
--- kernel-source-2.5/net/ipv4/ipcomp.c	19 Aug 2003 10:10:22 -0000	1.6
+++ kernel-source-2.5/net/ipv4/ipcomp.c	30 Oct 2003 10:39:55 -0000
@@ -344,10 +344,15 @@
 
 static int ipcomp_init_state(struct xfrm_state *x, void *args)
 {
-	int err = -ENOMEM;
+	int err;
 	struct ipcomp_data *ipcd;
 	struct xfrm_algo_desc *calg_desc;
 
+	err = -EINVAL;
+	if (!x->calg)
+		goto out;
+
+	err = -ENOMEM;
 	ipcd = kmalloc(sizeof(*ipcd), GFP_KERNEL);
 	if (!ipcd)
 		goto error;
Index: kernel-source-2.5/net/ipv6/ah6.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/ipv6/ah6.c,v
retrieving revision 1.6
diff -u -r1.6 ah6.c
--- kernel-source-2.5/net/ipv6/ah6.c	27 Sep 2003 03:05:52 -0000	1.6
+++ kernel-source-2.5/net/ipv6/ah6.c	30 Oct 2003 10:41:13 -0000
@@ -380,6 +380,9 @@
 	struct ah_data *ahp = NULL;
 	struct xfrm_algo_desc *aalg_desc;
 
+	if (!x->aalg)
+		goto error;
+
 	/* null auth can use a zero length key */
 	if (x->aalg->alg_key_len > 512)
 		goto error;
Index: kernel-source-2.5/net/ipv6/ipcomp6.c
===================================================================
RCS file: /home/gondolin/herbert/src/CVS/debian/kernel-source-2.5/net/ipv6/ipcomp6.c,v
retrieving revision 1.4
diff -u -r1.4 ipcomp6.c
--- kernel-source-2.5/net/ipv6/ipcomp6.c	19 Aug 2003 10:10:22 -0000	1.4
+++ kernel-source-2.5/net/ipv6/ipcomp6.c	30 Oct 2003 10:42:22 -0000
@@ -276,10 +276,15 @@
 
 static int ipcomp6_init_state(struct xfrm_state *x, void *args)
 {
-	int err = -ENOMEM;
+	int err;
 	struct ipcomp_data *ipcd;
 	struct xfrm_algo_desc *calg_desc;
 
+	err = -EINVAL;
+	if (!x->calg)
+		goto out;
+
+	err = -ENOMEM;
 	ipcd = kmalloc(sizeof(*ipcd), GFP_KERNEL);
 	if (!ipcd)
 		goto error;
-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux