powerpc/mm: Switch some TASK_SIZE checks to use mm_context addr_limit

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
This commit is contained in:
Aneesh Kumar K.V
2017-03-22 09:07:01 +05:30
committed by Michael Ellerman
parent 82228e362f
commit fbfef9027c
4 changed files with 13 additions and 12 deletions

View File

@@ -197,7 +197,8 @@ long sys_subpage_prot(unsigned long addr, unsigned long len, u32 __user *map)
/* Check parameters */
if ((addr & ~PAGE_MASK) || (len & ~PAGE_MASK) ||
addr >= TASK_SIZE || len >= TASK_SIZE || addr + len > TASK_SIZE)
addr >= mm->context.addr_limit || len >= mm->context.addr_limit ||
addr + len > mm->context.addr_limit)
return -EINVAL;
if (is_hugepage_only_range(mm, addr, len))