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

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

diff -u --recursive --new-file v1.3.6/linux/net/ipv4/af_inet.c linux/net/ipv4/af_inet.c
@@ -1280,6 +1280,7 @@
 {
 	struct sock *sk=(struct sock *)sock->data;
 	int err;
+	int tmp;
 
 	switch(cmd) 
 	{
@@ -1288,7 +1289,11 @@
 			err=verify_area(VERIFY_READ,(int *)arg,sizeof(long));
 			if(err)
 				return err;
-			sk->proc = get_fs_long((int *) arg);
+			tmp = get_fs_long((int *) arg);
+			/* see inet_fcntl */
+			if (current->pid != tmp && current->pgrp != -tmp && !suser())
+				return -EPERM;
+			sk->proc = tmp;
 			return(0);
 		case FIOGETOWN:
 		case SIOCGPGRP:

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov with Sam's (original) version
of this