patch-2.1.11 linux/net/ipv4/ipmr.c

Next file: linux/net/ipv4/packet.c
Previous file: linux/net/ipv4/ip_sockglue.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.10/linux/net/ipv4/ipmr.c linux/net/ipv4/ipmr.c
@@ -551,14 +551,16 @@
 		 *	Control PIM assert.
 		 */
 		case MRT_ASSERT:
+		{
+			int v;
 			if(optlen!=sizeof(int))
 				return -EINVAL;
-
-			/* BUG BUG this is wrong IMHO -AK. */ 
-			if((err=verify_area(VERIFY_READ, optval,sizeof(int)))<0)
-				return err;
-			mroute_do_pim= (optval)?1:0;
+			
+			if(get_user(v,(int *)optval))
+				return -EFAULT;
+			mroute_do_pim=(v)?1:0;
 			return 0;
+		}
 		/*
 		 *	Spurious command, or MRT_VERSION which you cannot
 		 *	set.

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov