Re: [PATCH v3] Simplify PTRACE_foo constants and PTRACE_SETOPTIONScode

From: Oleg Nesterov
Date: Thu Sep 08 2011 - 19:34:50 EST


On 09/08, Denys Vlasenko wrote:
>
> static int ptrace_setoptions(struct task_struct *child, unsigned long data)
> {
> ...
> + if (data & ~(unsigned long)PTRACE_O_MASK) {
> + child->ptrace &= ~PT_TRACE_MASK; /* historical bug */
> + return -EINVAL;
> + }

This is not right. You shouldn't simply return with -EINVAL, this change
adds another bug. Note that the cuurrent code sets the new bits even if
it returns -EINVAL.

Oleg.

--
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/