patch-2.2.0-pre2 linux/arch/ppc/kernel/ptrace.c
Next file: linux/arch/ppc/kernel/smp.c
Previous file: linux/arch/ppc/kernel/process.c
Back to the patch index
Back to the overall index
-  Lines: 20
-  Date:
Tue Dec 29 16:32:36 1998
-  Orig file: 
v2.2.0-pre1/linux/arch/ppc/kernel/ptrace.c
-  Orig date: 
Thu Aug  6 14:06:29 1998
diff -u --recursive --new-file v2.2.0-pre1/linux/arch/ppc/kernel/ptrace.c linux/arch/ppc/kernel/ptrace.c
@@ -362,7 +362,9 @@
 		case PTRACE_PEEKDATA: {
 			unsigned long tmp;
 
+			down(&child->mm->mmap_sem);
 			ret = read_long(child, addr, &tmp);
+			up(&child->mm->mmap_sem);
 			if (ret < 0)
 				goto out;
 			ret = verify_area(VERIFY_WRITE, (void *) data, sizeof(long));
@@ -410,7 +412,9 @@
       /* If I and D space are separate, this will have to be fixed. */
 		case PTRACE_POKETEXT: /* write the word at location addr. */
 		case PTRACE_POKEDATA:
+			down(&child->mm->mmap_sem);
 			ret = write_long(child,addr,data);
+			up(&child->mm->mmap_sem);
 			goto out;
 
 		case PTRACE_POKEUSR: /* write the word at location addr in the USER area */
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov