Commit 3c08f1d1 authored by Mike Frysinger's avatar Mike Frysinger Committed by Bryan Wu

Blackfin arch: have is_user_addr_valid() check for overflows (like when address is -1)

Signed-off-by: default avatarMike Frysinger <vapier.adi@gmail.com>
Signed-off-by: default avatarBryan Wu <cooloney@kernel.org>
parent d207a8c7
...@@ -160,6 +160,10 @@ static inline int is_user_addr_valid(struct task_struct *child, ...@@ -160,6 +160,10 @@ static inline int is_user_addr_valid(struct task_struct *child,
struct vm_list_struct *vml; struct vm_list_struct *vml;
struct sram_list_struct *sraml; struct sram_list_struct *sraml;
/* overflow */
if (start + len < start)
return -EIO;
for (vml = child->mm->context.vmlist; vml; vml = vml->next) for (vml = child->mm->context.vmlist; vml; vml = vml->next)
if (start >= vml->vma->vm_start && start + len < vml->vma->vm_end) if (start >= vml->vma->vm_start && start + len < vml->vma->vm_end)
return 0; return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment