Commit 286fa6c9 authored by Randy Dunlap's avatar Randy Dunlap Committed by Stephen Hemminger

[NET]: Remove verify_area() in net/wan/sbni (from domen@coderock.org)

parent d0ec1bd1
...@@ -1300,12 +1300,9 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) ...@@ -1300,12 +1300,9 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd )
switch( cmd ) { switch( cmd ) {
case SIOCDEVGETINSTATS : 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, if (copy_to_user( ifr->ifr_data, &nl->in_stats,
sizeof(struct sbni_in_stats) )) sizeof(struct sbni_in_stats) ))
return -EFAULT; error = -EFAULT;
break; break;
case SIOCDEVRESINSTATS : case SIOCDEVRESINSTATS :
...@@ -1321,11 +1318,8 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) ...@@ -1321,11 +1318,8 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd )
flags.rxl = nl->cur_rxl_index; flags.rxl = nl->cur_rxl_index;
flags.fixed_rxl = nl->delta_rxl == 0; 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 )) if (copy_to_user( ifr->ifr_data, &flags, sizeof flags ))
return -EFAULT; error = -EFAULT;
break; break;
case SIOCDEVSHWSTATE : case SIOCDEVSHWSTATE :
...@@ -1353,10 +1347,6 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) ...@@ -1353,10 +1347,6 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd )
if( current->euid != 0 ) /* root only */ if( current->euid != 0 ) /* root only */
return -EPERM; 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 )) if (copy_from_user( slave_name, ifr->ifr_data, sizeof slave_name ))
return -EFAULT; return -EFAULT;
slave_dev = dev_get_by_name( slave_name ); slave_dev = dev_get_by_name( slave_name );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment