Re: [PATCH -mm 1/1] ptrace: PTRACE_GETFDPIC: fix the unsafe usage of child->mm

From: David Howells
Date: Mon May 24 2010 - 10:37:48 EST


Oleg Nesterov <oleg@xxxxxxxxxx> wrote:

> Now that Mike Frysinger unified the FDPIC ptrace code, we can fix
> the unsafe usage of child->mm in ptrace_request(PTRACE_GETFDPIC).
>
> We have the reference to task_struct, and ptrace_check_attach()
> verified the tracee is stopped. But nothing can protect from
> SIGKILL after that, we must not assume child->mm != NULL.
>
> Signed-off-by: Oleg Nesterov <oleg@xxxxxxxxxx>

Acked-by: David Howells <dhowells@xxxxxxxxxx>

Does it make sense to move the call to get_task_mm() up to sys_ptrace() since
several ptrace functions use it? The mm pointer could then be handed down the
ptrace hierarchy.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/