patch-2.1.30 linux/kernel/signal.c

Next file: linux/kernel/softirq.c
Previous file: linux/kernel/sched.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.29/linux/kernel/signal.c linux/kernel/signal.c
@@ -170,40 +170,24 @@
 	struct sigaction * oldaction)
 {
 	struct sigaction new_sa, *p;
-	int ret = -EINVAL;
 
-	lock_kernel();
 	if (signum<1 || signum>32)
-		goto out;
+		return -EINVAL;
 	p = signum - 1 + current->sig->action;
 	if (action) {
-		ret = verify_area(VERIFY_READ, action, sizeof(*action));
-		if (ret)
-			goto out;
-		ret = -EINVAL;
-		if (signum==SIGKILL || signum==SIGSTOP)
-			goto out;
-		ret = -EFAULT;
 		if (copy_from_user(&new_sa, action, sizeof(struct sigaction)))
-			goto out;
-		if (new_sa.sa_handler != SIG_DFL && new_sa.sa_handler != SIG_IGN) {
-			ret = verify_area(VERIFY_READ, new_sa.sa_handler, 1);
-			if (ret)
-				goto out;
-		}
+			return -EFAULT;
+		if (signum==SIGKILL || signum==SIGSTOP)
+			return -EINVAL;
 	}
-	ret = -EFAULT;
 	if (oldaction) {
 		if (copy_to_user(oldaction, p, sizeof(struct sigaction)))
-			goto out;	
+			return -EFAULT;
 	}
 	if (action) {
 		*p = new_sa;
 		check_pending(signum);
 	}
-	ret = 0;
-out:
-	unlock_kernel();
-	return ret;
+	return 0;
 }
 #endif

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