diff options
author | Mike Frysinger <vapier.adi@gmail.com> | 2008-10-10 17:12:51 +0800 |
---|---|---|
committer | Bryan Wu <cooloney@kernel.org> | 2008-10-10 17:12:51 +0800 |
commit | 3c08f1d122627c9559fb03a11f52ea37f960b61e (patch) | |
tree | 1ad1ae12d18df4c8f92de734e26612abb05a6580 | |
parent | d207a8c7681f14302e9e80ef5b8202abe39060b5 (diff) | |
download | talos-op-linux-3c08f1d122627c9559fb03a11f52ea37f960b61e.tar.gz talos-op-linux-3c08f1d122627c9559fb03a11f52ea37f960b61e.zip |
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>
-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, 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; |