]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
Blackfin arch: have is_user_addr_valid() check for overflows (like when address is -1)
authorMike Frysinger <vapier.adi@gmail.com>
Fri, 10 Oct 2008 09:12:51 +0000 (17:12 +0800)
committerBryan Wu <cooloney@kernel.org>
Fri, 10 Oct 2008 09:12:51 +0000 (17:12 +0800)
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
arch/blackfin/kernel/ptrace.c

index 7e1f762b670052c961e47c31f78f719e96b6c973..140bf00e99749f6fee7e9aec85149f9872c1d03f 100644 (file)
@@ -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;