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:
Родитель
d207a8c768
Коммит
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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче