Patch "powerpc/mm: Prevent unlikely crash in copro_calculate_slb()" has been added to the 4.8-stable tree
From: <gregkh@linuxfoundation.org>
Date: 2016-10-26 12:01:42
This is a note to let you know that I've just added the patch titled
powerpc/mm: Prevent unlikely crash in copro_calculate_slb()
to the 4.8-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
The filename of the patch is:
powerpc-mm-prevent-unlikely-crash-in-copro_calculate_slb.patch
and it can be found in the queue-4.8 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let [off-list ref] know about it.
From d2cf909cda5f8c5609cb7ed6cda816c3e15528c7 Mon Sep 17 00:00:00 2001
From: Frederic Barrat <redacted>
Date: Fri, 17 Jun 2016 18:53:28 +0200
Subject: powerpc/mm: Prevent unlikely crash in copro_calculate_slb()
From: Frederic Barrat <redacted>
commit d2cf909cda5f8c5609cb7ed6cda816c3e15528c7 upstream.
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: 73d16a6e0e51 ("powerpc/cell: Move data segment faulting code out of cell platform")
Signed-off-by: Frederic Barrat <redacted>
Acked-by: Ian Munsie <redacted>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/powerpc/mm/copro_fault.c | 2 ++
1 file changed, 2 insertions(+)
--- a/arch/powerpc/mm/copro_fault.c
+++ b/arch/powerpc/mm/copro_fault.c@@ -106,6 +106,8 @@ int copro_calculate_slb(struct mm_struct switch (REGION_ID(ea)) { case USER_REGION_ID: pr_devel("%s: 0x%llx -- USER_REGION_ID\n", __func__, ea); + if (mm == NULL) + return 1; psize = get_slice_psize(mm, ea); ssize = user_segment_size(ea); vsid = get_vsid(mm->context.id, ea, ssize);
Patches currently in stable-queue which might be from fbarrat@linux.vnet.ibm.com are queue-4.8/cxl-prevent-adapter-reset-if-an-active-context-exists.patch queue-4.8/powerpc-mm-prevent-unlikely-crash-in-copro_calculate_slb.patch