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>
This commit is contained in:
parent
d207a8c768
commit
3c08f1d122
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user