[3.8.y.z extended stable] Patch "mm/memory-failure.c-failure: send right signal code to correct thread" has been added to staging queue
Kamal Mostafa
kamal at canonical.com
Mon Jul 21 21:21:40 UTC 2014
This is a note to let you know that I have just added a patch titled
mm/memory-failure.c-failure: send right signal code to correct thread
to the linux-3.8.y-queue branch of the 3.8.y.z extended stable tree
which can be found at:
http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.8.y-queue
This patch is scheduled to be released in version 3.8.13.27.
If you, or anyone else, feels it should not be added to this tree, please
reply to this email.
For more information about the 3.8.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable
Thanks.
-Kamal
------
>From 191dad4e02639331f6679f7c0996655157ecc9d1 Mon Sep 17 00:00:00 2001
From: Tony Luck <tony.luck at intel.com>
Date: Wed, 4 Jun 2014 16:10:59 -0700
Subject: mm/memory-failure.c-failure: send right signal code to correct thread
commit a70ffcac741d31a406c1d2b832ae43d658e7e1cf upstream.
When a thread in a multi-threaded application hits a machine check because
of an uncorrectable error in memory - we want to send the SIGBUS with
si.si_code = BUS_MCEERR_AR to that thread. Currently we fail to do that
if the active thread is not the primary thread in the process.
collect_procs() just finds primary threads and this test:
if ((flags & MF_ACTION_REQUIRED) && t == current) {
will see that the thread we found isn't the current thread and so send a
si.si_code = BUS_MCEERR_AO to the primary (and nothing to the active
thread at this time).
We can fix this by checking whether "current" shares the same mm with the
process that collect_procs() said owned the page. If so, we send the
SIGBUS to current (with code BUS_MCEERR_AR).
Signed-off-by: Tony Luck <tony.luck at intel.com>
Signed-off-by: Naoya Horiguchi <n-horiguchi at ah.jp.nec.com>
Reported-by: Otto Bruggeman <otto.g.bruggeman at intel.com>
Cc: Andi Kleen <andi at firstfloor.org>
Cc: Borislav Petkov <bp at suse.de>
Cc: Chen Gong <gong.chen at linux.jf.intel.com>
Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds at linux-foundation.org>
Signed-off-by: Kamal Mostafa <kamal at canonical.com>
---
mm/memory-failure.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/memory-failure.c b/mm/memory-failure.c
index d3ed748..0af800c 100644
--- a/mm/memory-failure.c
+++ b/mm/memory-failure.c
@@ -208,9 +208,9 @@ static int kill_proc(struct task_struct *t, unsigned long addr, int trapno,
#endif
si.si_addr_lsb = compound_trans_order(compound_head(page)) + PAGE_SHIFT;
- if ((flags & MF_ACTION_REQUIRED) && t == current) {
+ if ((flags & MF_ACTION_REQUIRED) && t->mm == current->mm) {
si.si_code = BUS_MCEERR_AR;
- ret = force_sig_info(SIGBUS, &si, t);
+ ret = force_sig_info(SIGBUS, &si, current);
} else {
/*
* Don't use force here, it's convenient if the signal
--
1.9.1
More information about the kernel-team
mailing list