]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
powerpc/mm/coproc: Handle bad address on coproc slb fault
authorAneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Tue, 15 Nov 2016 15:06:06 +0000 (20:36 +0530)
committerMichael Ellerman <mpe@ellerman.id.au>
Tue, 22 Nov 2016 00:57:08 +0000 (11:57 +1100)
VSID 0 is bad address. Don't create slb entries on coproc fault for
bad address

Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com>
Reviewed-by: Balbir Singh <bsingharora@gmail.com>
Reviewed-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/copro_fault.c

index 362954f98029b46d4d3d312b239bb7a2fa8fe63a..aaa7ec6788b9ee5b69da6a1004808a8d60f8ecc2 100644 (file)
@@ -134,6 +134,9 @@ int copro_calculate_slb(struct mm_struct *mm, u64 ea, struct copro_slb *slb)
                pr_debug("%s: invalid region access at %016llx\n", __func__, ea);
                return 1;
        }
+       /* Bad address */
+       if (!vsid)
+               return 1;
 
        vsid = (vsid << slb_vsid_shift(ssize)) | vsidkey;