diff options
author | Mike Frysinger <vapier.adi@gmail.com> | 2008-10-10 05:12:51 -0400 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-10-10 05:12:51 -0400 |
commit | 3c08f1d122627c9559fb03a11f52ea37f960b61e (patch) | |
tree | 1ad1ae12d18df4c8f92de734e26612abb05a6580 /arch | |
parent | d207a8c7681f14302e9e80ef5b8202abe39060b5 (diff) |
Blackfin arch: have is_user_addr_valid() check for overflows (like when address is -1)
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/blackfin/kernel/ptrace.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/blackfin/kernel/ptrace.c b/arch/blackfin/kernel/ptrace.c index 7e1f762b6700..140bf00e9974 100644 --- a/arch/blackfin/kernel/ptrace.c +++ b/arch/blackfin/kernel/ptrace.c | |||
@@ -160,6 +160,10 @@ static inline int is_user_addr_valid(struct task_struct *child, | |||
160 | struct vm_list_struct *vml; | 160 | struct vm_list_struct *vml; |
161 | struct sram_list_struct *sraml; | 161 | struct sram_list_struct *sraml; |
162 | 162 | ||
163 | /* overflow */ | ||
164 | if (start + len < start) | ||
165 | return -EIO; | ||
166 | |||
163 | for (vml = child->mm->context.vmlist; vml; vml = vml->next) | 167 | for (vml = child->mm->context.vmlist; vml; vml = vml->next) |
164 | if (start >= vml->vma->vm_start && start + len < vml->vma->vm_end) | 168 | if (start >= vml->vma->vm_start && start + len < vml->vma->vm_end) |
165 | return 0; | 169 | return 0; |