Re: [Linux-ia64] kernel update (relative to v2.4.0-test1)

Manfred Spraul
2000-06-03T17:32:18Z

David Mosberger wrote:
>
> - ptrace interface should work again (at least strace works...)
>
There is a race in sys_ptrace that I fixed on i386:

arch/ia64/kernel/ptrace.c ~ line 830:

read_lock(&tasklist_lock);
child = find_task_by_pid(pid);
read_unlock(&tasklist_lock);
************ bad! the task could die!
if(!child)
goto out;

You must call get_task_struct() before read_unlock(&tasklist_lock);

Then you dereference child->mm. child->mm can change, you must call
task_lock(child);
task_unlock(child)
around these lines [check fs/proc/*.c]

Btw, child->mm can be NULL.

--
Manfred