]> git.hungrycats.org Git - linux/commitdiff
[PATCH] Pass correct task to get_user_pages in ptrace
authorAndrew Morton <akpm@osdl.org>
Mon, 29 Mar 2004 06:50:19 +0000 (22:50 -0800)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Mon, 29 Mar 2004 06:50:19 +0000 (22:50 -0800)
From: Andi Kleen <ak@suse.de>

ptrace/access_process_vm was passing current to get_user_pages as task, but
it should have been clearly the child task instead.

This fixes the fault accounting in ptrace and the vsyscall debugging on
x86-64 (it needs the correct task_struct to map the vsyscall pages)

kernel/ptrace.c

index c1ebfd8b714e787784183a6a5333dc5ee7191162..8b2856aaf6410310d83751e1af1bef61bf447115 100644 (file)
@@ -168,7 +168,7 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
                int bytes, ret, offset;
                void *maddr;
 
-               ret = get_user_pages(current, mm, addr, 1,
+               ret = get_user_pages(tsk, mm, addr, 1,
                                write, 1, &page, &vma);
                if (ret <= 0)
                        break;