aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--kernel/ptrace.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c
index 00ab2ca5ed11..273f56ea39d2 100644
--- a/kernel/ptrace.c
+++ b/kernel/ptrace.c
@@ -528,6 +528,9 @@ int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long ds
528 528
529static int ptrace_setoptions(struct task_struct *child, unsigned long data) 529static int ptrace_setoptions(struct task_struct *child, unsigned long data)
530{ 530{
531 if (data & ~(unsigned long)PTRACE_O_MASK)
532 return -EINVAL;
533
531 child->ptrace &= ~PT_TRACE_MASK; 534 child->ptrace &= ~PT_TRACE_MASK;
532 535
533 if (data & PTRACE_O_TRACESYSGOOD) 536 if (data & PTRACE_O_TRACESYSGOOD)
@@ -551,7 +554,7 @@ static int ptrace_setoptions(struct task_struct *child, unsigned long data)
551 if (data & PTRACE_O_TRACEEXIT) 554 if (data & PTRACE_O_TRACEEXIT)
552 child->ptrace |= PT_TRACE_EXIT; 555 child->ptrace |= PT_TRACE_EXIT;
553 556
554 return (data & ~PTRACE_O_MASK) ? -EINVAL : 0; 557 return 0;
555} 558}
556 559
557static int ptrace_getsiginfo(struct task_struct *child, siginfo_t *info) 560static int ptrace_getsiginfo(struct task_struct *child, siginfo_t *info)