Skip to content

Commit

Permalink
Blackfin arch: have is_user_addr_valid() check for overflows (like wh…
Browse files Browse the repository at this point in the history
…en address is -1)

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
  • Loading branch information
Mike Frysinger authored and Bryan Wu committed Oct 10, 2008
1 parent d207a8c commit 3c08f1d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/blackfin/kernel/ptrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ static inline int is_user_addr_valid(struct task_struct *child,
struct vm_list_struct *vml;
struct sram_list_struct *sraml;

/* overflow */
if (start + len < start)
return -EIO;

for (vml = child->mm->context.vmlist; vml; vml = vml->next)
if (start >= vml->vma->vm_start && start + len < vml->vma->vm_end)
return 0;
Expand Down

0 comments on commit 3c08f1d

Please sign in to comment.