patch-2.1.10 linux/net/ipv4/af_inet.c

Next file: linux/net/ipv4/arp.c
Previous file: linux/net/core/sock.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.9/linux/net/ipv4/af_inet.c linux/net/ipv4/af_inet.c
@@ -1208,10 +1208,9 @@
 	{
 		case FIOSETOWN:
 		case SIOCSPGRP:
-			err=verify_area(VERIFY_READ,(int *)arg,sizeof(long));
-			if(err)
-				return err;
-			get_user(pid, (int *) arg);
+			err = get_user(pid, (int *) arg);
+			if (err)
+				return err; 
 			/* see inet_fcntl */
 			if (current->pid != pid && current->pgrp != -pid && !suser())
 				return -EPERM;
@@ -1219,19 +1218,16 @@
 			return(0);
 		case FIOGETOWN:
 		case SIOCGPGRP:
-			err=verify_area(VERIFY_WRITE,(void *) arg, sizeof(int));
-			if(err)
-				return err;
-			put_user(sk->proc, (int *)arg);
-			return(0);			
+			return put_user(sk->proc, (int *)arg);
 		case SIOCGSTAMP:
 			if(sk->stamp.tv_sec==0)
 				return -ENOENT;
-			err=verify_area(VERIFY_WRITE,(void *)arg,sizeof(struct timeval));
-			if(err)
-				return err;
-			copy_to_user((void *)arg,&sk->stamp,sizeof(struct timeval));
-			return 0;
+			err = copy_to_user((void *)arg,&sk->stamp,sizeof(struct timeval));
+			if (err)
+			{
+				err = -EFAULT;
+			}
+			return err;
 		case SIOCADDRT:
 		case SIOCDELRT:
 			return(ip_rt_ioctl(cmd,(void *) arg));

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