From 60ea0a5bd15c5c8c94587ddd216484fff7661cbd Mon Sep 17 00:00:00 2001 From: Denys Vlasenko Date: Fri, 23 Mar 2012 15:02:40 -0700 Subject: [PATCH] --- yaml --- r: 295257 b: refs/heads/master c: 8c5cf9e5c50dc902713897e10201aa71f3546aa1 h: refs/heads/master i: 295255: 346dd81ecd4dab42eeb199b20faf67c9948785da v: v3 --- [refs] | 2 +- trunk/kernel/ptrace.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index 510b8039d5e7..be3429fa40d5 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: b1845ff53f1a9eadba005ae53dfe60ab00dfe83b +refs/heads/master: 8c5cf9e5c50dc902713897e10201aa71f3546aa1 diff --git a/trunk/kernel/ptrace.c b/trunk/kernel/ptrace.c index 00ab2ca5ed11..273f56ea39d2 100644 --- a/trunk/kernel/ptrace.c +++ b/trunk/kernel/ptrace.c @@ -528,6 +528,9 @@ int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long ds static int ptrace_setoptions(struct task_struct *child, unsigned long data) { + if (data & ~(unsigned long)PTRACE_O_MASK) + return -EINVAL; + child->ptrace &= ~PT_TRACE_MASK; if (data & PTRACE_O_TRACESYSGOOD) @@ -551,7 +554,7 @@ static int ptrace_setoptions(struct task_struct *child, unsigned long data) if (data & PTRACE_O_TRACEEXIT) child->ptrace |= PT_TRACE_EXIT; - return (data & ~PTRACE_O_MASK) ? -EINVAL : 0; + return 0; } static int ptrace_getsiginfo(struct task_struct *child, siginfo_t *info)