Commit 0d986b96 authored by Dave Jones's avatar Dave Jones Committed by Linus Torvalds

[PATCH] missing copy_*_user checks in sbni wan driver

parent 9739f37d
...@@ -1287,8 +1287,9 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) ...@@ -1287,8 +1287,9 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd )
error = verify_area( VERIFY_WRITE, ifr->ifr_data, error = verify_area( VERIFY_WRITE, ifr->ifr_data,
sizeof(struct sbni_in_stats) ); sizeof(struct sbni_in_stats) );
if( !error ) if( !error )
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;
break; break;
case SIOCDEVRESINSTATS : case SIOCDEVRESINSTATS :
...@@ -1307,7 +1308,8 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) ...@@ -1307,7 +1308,8 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd )
error = verify_area( VERIFY_WRITE, ifr->ifr_data, error = verify_area( VERIFY_WRITE, ifr->ifr_data,
sizeof flags ); sizeof flags );
if( !error ) if( !error )
copy_to_user( ifr->ifr_data, &flags, sizeof flags ); if (copy_to_user( ifr->ifr_data, &flags, sizeof flags ))
return -EFAULT;
break; break;
case SIOCDEVSHWSTATE : case SIOCDEVSHWSTATE :
...@@ -1339,7 +1341,8 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd ) ...@@ -1339,7 +1341,8 @@ sbni_ioctl( struct net_device *dev, struct ifreq *ifr, int cmd )
sizeof slave_name )) != 0 ) sizeof slave_name )) != 0 )
return error; return error;
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;
slave_dev = dev_get_by_name( slave_name ); slave_dev = dev_get_by_name( slave_name );
if( !slave_dev || !(slave_dev->flags & IFF_UP) ) { if( !slave_dev || !(slave_dev->flags & IFF_UP) ) {
printk( KERN_ERR "%s: trying to enslave non-active " printk( KERN_ERR "%s: trying to enslave non-active "
......
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