Subject: [PATCH] janitor: remove verify_area() in net/wan/sbni

From: "Randy.Dunlap" <[email-masked]>
Date: Fri, 3 Oct 2003 21:35:17 -0700

Hi,
Please apply to 2.6.0-test6-current.

Thanks,
--
~Randy

From: Domen Puncer <[email-masked]>
Subject: [Kernel-janitors] [PATCH] updated: verify_area:
 	drivers/net/wan/sbni.c

Someone added error checking to copy_*_user, so this [earlier] patch
didn't apply.

Removed unnecessary verify_area.

 linux-260-test6-kj1-rddunlap/drivers/net/wan/sbni.c |   20 +++++---------------
 1 files changed, 5 insertions(+), 15 deletions(-)

diff -puN drivers/net/wan/sbni.c~net_wan_sbni_verify drivers/net/wan/sbni.c
--- linux-260-test6-kj1/drivers/net/wan/sbni.c~net_wan_sbni_verify	2003-09-29 17:39:09.000000000 -0700
+++ linux-260-test6-kj1-rddunlap/drivers/net/wan/sbni.c	2003-09-29 17:39:09.000000000 -0700
@@ -1300,12 +1300,9 @@ sbni_ioctl( struct net_device  *dev,  st
   
 	switch( cmd ) {
 	case  SIOCDEVGETINSTATS :
-		error = verify_area( VERIFY_WRITE, ifr->ifr_data,
-				     sizeof(struct sbni_in_stats) );
-		if( !error )
-			if (copy_to_user( ifr->ifr_data, &nl->in_stats,
-				      sizeof(struct sbni_in_stats) ))
-				return -EFAULT;
+		if (copy_to_user( ifr->ifr_data, &nl->in_stats,
+					sizeof(struct sbni_in_stats) ))
+			error = -EFAULT;
 		break;
 
 	case  SIOCDEVRESINSTATS :
@@ -1321,11 +1318,8 @@ sbni_ioctl( struct net_device  *dev,  st
 		flags.rxl	= nl->cur_rxl_index;
 		flags.fixed_rxl	= nl->delta_rxl == 0;
 
-		error = verify_area( VERIFY_WRITE, ifr->ifr_data,
-				     sizeof flags );
-		if( !error )
-			if (copy_to_user( ifr->ifr_data, &flags, sizeof flags ))
-				return -EFAULT;
+		if (copy_to_user( ifr->ifr_data, &flags, sizeof flags ))
+			error = -EFAULT;
 		break;
 
 	case  SIOCDEVSHWSTATE :
@@ -1353,10 +1347,6 @@ sbni_ioctl( struct net_device  *dev,  st
 		if( current->euid != 0 )	/* root only */
 			return  -EPERM;
 
-		if( (error = verify_area( VERIFY_READ, ifr->ifr_data,
-					  sizeof slave_name )) != 0 )
-			return  error;
-
 		if (copy_from_user( slave_name, ifr->ifr_data, sizeof slave_name ))
 			return -EFAULT;
 		slave_dev = dev_get_by_name( slave_name );

_