summaryrefslogtreecommitdiff
path: root/arch/powerpc/mm/subpage-prot.c
diff options
context:
space:
mode:
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>2017-04-13 22:18:21 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2017-04-19 13:00:18 +0300
commitbe77e999e3937322b7e15274b8fc7da309a040a0 (patch)
treee850b22d9ee7ae37a8e5b8ceb6f16fad8ae1b7e3 /arch/powerpc/mm/subpage-prot.c
parent8d1b48ef580097e111c2644e6fc6041b9784d218 (diff)
downloadlinux-be77e999e3937322b7e15274b8fc7da309a040a0.tar.xz
powerpc/mm/radix: Use mm->task_size for boundary checking instead of addr_limit
We don't init addr_limit correctly for 32 bit applications. So default to using mm->task_size for boundary condition checking. We use addr_limit to only control free space search. This makes sure that we do the right thing with 32 bit applications. We should consolidate the usage of TASK_SIZE/mm->task_size and mm->context.addr_limit later. This partially reverts commit fbfef9027c2a7ad (powerpc/mm: Switch some TASK_SIZE checks to use mm_context addr_limit). Fixes: fbfef9027c2a ("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>
Diffstat (limited to 'arch/powerpc/mm/subpage-prot.c')
-rw-r--r--arch/powerpc/mm/subpage-prot.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/arch/powerpc/mm/subpage-prot.c b/arch/powerpc/mm/subpage-prot.c
index a409f78d206b..e94fbd4c8845 100644
--- a/arch/powerpc/mm/subpage-prot.c
+++ b/arch/powerpc/mm/subpage-prot.c
@@ -197,8 +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 >= mm->context.addr_limit || len >= mm->context.addr_limit ||
- addr + len > mm->context.addr_limit)
+ addr >= mm->task_size || len >= mm->task_size ||
+ addr + len > mm->task_size)
return -EINVAL;
if (is_hugepage_only_range(mm, addr, len))