[PATCH] powerpc: Fix do_page_fault to check for HWPOISON flag.
Henish Patel
hpatel at linux.vnet.ibm.com
Tue Sep 23 15:42:36 EST 2014
The current implementation of do_page_fault does not check whether the
page being accessed is marked hwpiosoned or not. Hence when an
application tries to access page that is marked hwpoisoned, it results
into Linux hypervisor crash and system goes into IPLing state.
This patch fixes this issue by adding a check for HWPOISON flag and send
SIGBUS to an application that is trying to access hwpoisoned page.
Signed-off-by: Henish Patel <hpatel at linux.vnet.ibm.com>
---
arch/powerpc/mm/fault.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
index 51ab9e7..5e9b4fd 100644
--- a/arch/powerpc/mm/fault.c
+++ b/arch/powerpc/mm/fault.c
@@ -170,10 +170,10 @@ static int mm_fault_error(struct pt_regs *regs, unsigned long addr, int fault)
return MM_FAULT_RETURN;
}
- /* Bus error. x86 handles HWPOISON here, we'll add this if/when
- * we support the feature in HW
+ /* Send SIGBUS to the application when it tries to access a page,
+ * which has been marked as HWPOISON.
*/
- if (fault & VM_FAULT_SIGBUS)
+ if (fault & (VM_FAULT_SIGBUS|VM_FAULT_HWPOISON))
return do_sigbus(regs, addr);
/* We don't understand the fault code, this is fatal */
More information about the Linuxppc-dev
mailing list