patch-2.4.3 linux/net/ipv6/ipv6_sockglue.c

Next file: linux/net/ipv6/reassembly.c
Previous file: linux/net/ipv6/ip6_fib.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.2/linux/net/ipv6/ipv6_sockglue.c linux/net/ipv6/ipv6_sockglue.c
@@ -7,7 +7,7 @@
  *
  *	Based on linux/net/ipv4/ip_sockglue.c
  *
- *	$Id: ipv6_sockglue.c,v 1.34 2000/11/28 13:44:28 davem Exp $
+ *	$Id: ipv6_sockglue.c,v 1.36 2001/02/26 05:59:07 davem Exp $
  *
  *	This program is free software; you can redistribute it and/or
  *      modify it under the terms of the GNU General Public License
@@ -252,6 +252,13 @@
 
 		if (optlen == 0)
 			goto update;
+
+		/* 1K is probably excessive
+		 * 1K is surely not enough, 2K per standard header is 16K.
+		 */
+		retv = -EINVAL;
+		if (optlen > 64*1024)
+			break;
 
 		opt = sock_kmalloc(sk, sizeof(*opt) + optlen, GFP_KERNEL);
 		retv = -ENOBUFS;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)