diff options
Diffstat (limited to 'kernel/ptrace.c')
| -rw-r--r-- | kernel/ptrace.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/kernel/ptrace.c b/kernel/ptrace.c index 88b306c4e841..8dcb8f6288bc 100644 --- a/kernel/ptrace.c +++ b/kernel/ptrace.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/smp_lock.h> | 16 | #include <linux/smp_lock.h> |
| 17 | #include <linux/ptrace.h> | 17 | #include <linux/ptrace.h> |
| 18 | #include <linux/security.h> | 18 | #include <linux/security.h> |
| 19 | #include <linux/signal.h> | ||
| 19 | 20 | ||
| 20 | #include <asm/pgtable.h> | 21 | #include <asm/pgtable.h> |
| 21 | #include <asm/uaccess.h> | 22 | #include <asm/uaccess.h> |
| @@ -135,7 +136,7 @@ int ptrace_attach(struct task_struct *task) | |||
| 135 | (current->gid != task->sgid) || | 136 | (current->gid != task->sgid) || |
| 136 | (current->gid != task->gid)) && !capable(CAP_SYS_PTRACE)) | 137 | (current->gid != task->gid)) && !capable(CAP_SYS_PTRACE)) |
| 137 | goto bad; | 138 | goto bad; |
| 138 | rmb(); | 139 | smp_rmb(); |
| 139 | if (!task->mm->dumpable && !capable(CAP_SYS_PTRACE)) | 140 | if (!task->mm->dumpable && !capable(CAP_SYS_PTRACE)) |
| 140 | goto bad; | 141 | goto bad; |
| 141 | /* the same process cannot be attached many times */ | 142 | /* the same process cannot be attached many times */ |
| @@ -166,7 +167,7 @@ bad: | |||
| 166 | 167 | ||
| 167 | int ptrace_detach(struct task_struct *child, unsigned int data) | 168 | int ptrace_detach(struct task_struct *child, unsigned int data) |
| 168 | { | 169 | { |
| 169 | if ((unsigned long) data > _NSIG) | 170 | if (!valid_signal(data)) |
| 170 | return -EIO; | 171 | return -EIO; |
| 171 | 172 | ||
| 172 | /* Architecture-specific hardware disable .. */ | 173 | /* Architecture-specific hardware disable .. */ |
