From: Mike Frysinger Date: Fri, 10 Oct 2008 09:12:51 +0000 (+0800) Subject: Blackfin arch: have is_user_addr_valid() check for overflows (like when address is -1) X-Git-Tag: firefly_0821_release~17712^2~15 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3c08f1d122627c9559fb03a11f52ea37f960b61e;p=firefly-linux-kernel-4.4.55.git Blackfin arch: have is_user_addr_valid() check for overflows (like when address is -1) Signed-off-by: Mike Frysinger Signed-off-by: Bryan Wu --- 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, 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;