patch-2.1.37 linux/fs/fcntl.c

Next file: linux/fs/file_table.c
Previous file: linux/fs/ext2/super.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.36/linux/fs/fcntl.c linux/fs/fcntl.c
@@ -163,6 +163,7 @@
 			if (current->pgrp == -arg || current->pid == arg)
 				goto fasync_ok;
 			
+			read_lock(&tasklist_lock);
 			for_each_task(p) {
 				if ((p->pid == arg) || (p->pid == -arg) || 
 				    (p->pgrp == -arg)) {
@@ -171,11 +172,14 @@
 					if ((p->session != current->session) &&
 					    (p->uid != current->uid) &&
 					    (p->euid != current->euid) &&
-					    !suser())
+					    !suser()) {
+						read_unlock(&tasklist_lock);
 						goto out;
+					}
 					break;
 				}
 			}
+			read_unlock(&tasklist_lock);
 			err = -EINVAL;
 			if ((task_found == 0) && !suser())
 				break;

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