patch-2.1.72 linux/net/core/sock.c

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

diff -u --recursive --new-file v2.1.71/linux/net/core/sock.c linux/net/core/sock.c
@@ -75,6 +75,7 @@
  *                                      protocol private data.
  *              Steve Whitehouse:       Added various other default routines
  *                                      common to several socket families.
+ *              Chris Evans     :       Call suser() check last on F_SETOWN
  *
  * To Fix:
  *
@@ -938,8 +939,9 @@
 			 * way to make sure that you can't send a sigurg to
 			 * another process.
 			 */
-			if (!suser() && current->pgrp != -arg &&
-				current->pid != arg) return(-EPERM);
+			if (current->pgrp != -arg &&
+				current->pid != arg &&
+				!suser()) return(-EPERM);
 			sk->proc = arg;
 			return(0);
 		case F_GETOWN:

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