]> git.baikalelectronics.ru Git - kernel.git/commit
powerpc/mm: Prevent unlikely crash in copro_calculate_slb()
authorFrederic Barrat <fbarrat@linux.vnet.ibm.com>
Fri, 17 Jun 2016 16:53:28 +0000 (18:53 +0200)
committerMichael Ellerman <mpe@ellerman.id.au>
Wed, 19 Oct 2016 09:32:49 +0000 (20:32 +1100)
commitd1a12c673c25f7554e975ab78ca5de34a878eeac
tree5d33b795fcf64aba8e091649544b551b20c23015
parenta245803230f587f66ceddc152f3504b2a960aac2
powerpc/mm: Prevent unlikely crash in copro_calculate_slb()

If a cxl adapter faults on an invalid address for a kernel context, we
may enter copro_calculate_slb() with a NULL mm pointer (kernel
context) and an effective address which looks like a user
address. Which will cause a crash when dereferencing mm. It is clearly
an AFU bug, but there's no reason to crash either. So return an error,
so that cxl can ack the interrupt with an address error.

Fixes: 5f8c86cc42a4 ("powerpc/cell: Move data segment faulting code out of cell platform")
Cc: stable@vger.kernel.org # v3.18+
Signed-off-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
arch/powerpc/mm/copro_fault.c