lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <tip-14c0abf14a5e67e793131116bd97f57da37ccce3@git.kernel.org>
Date:	Tue, 22 Sep 2009 19:09:43 GMT
From:	tip-bot for Huang Ying <ying.huang@...el.com>
To:	linux-tip-commits@...r.kernel.org
Cc:	linux-kernel@...r.kernel.org, hpa@...or.com, mingo@...hat.com,
	seto.hidetoshi@...fujitsu.com, dnelson@...hat.com,
	ying.huang@...el.com, ak@...ux.intel.com, tglx@...utronix.de,
	mingo@...e.hu
Subject: [tip:x86/urgent] x86: mce, inject: Use real inject-msg in raise_local

Commit-ID:  14c0abf14a5e67e793131116bd97f57da37ccce3
Gitweb:     http://git.kernel.org/tip/14c0abf14a5e67e793131116bd97f57da37ccce3
Author:     Huang Ying <ying.huang@...el.com>
AuthorDate: Tue, 22 Sep 2009 14:35:57 +0800
Committer:  Ingo Molnar <mingo@...e.hu>
CommitDate: Tue, 22 Sep 2009 21:06:37 +0200

x86: mce, inject: Use real inject-msg in raise_local

Current raise_local() uses a struct mce that comes from mce_write()
as a parameter instead of the real inject-msg, so when we set
mce.finished = 0 to clear injected MCE, the real inject stays
valid.

This will cause the remaining inject-msg affect the next injection,
which is not desired.

To fix this, real inject-msg is used in raise_local instead of the
one on the stack.

This patch is based on the diagnosis and the fixes by Dean Nelson.

Reported-by: Dean Nelson <dnelson@...hat.com>
Signed-off-by: Huang Ying <ying.huang@...el.com>
Cc: Hidetoshi Seto <seto.hidetoshi@...fujitsu.com>
Cc: Andi Kleen <ak@...ux.intel.com>
LKML-Reference: <1253601357.15717.757.camel@...ang-dev.sh.intel.com>
Signed-off-by: Ingo Molnar <mingo@...e.hu>


---
 arch/x86/kernel/cpu/mcheck/mce-inject.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce-inject.c b/arch/x86/kernel/cpu/mcheck/mce-inject.c
index 7029f0e..472763d 100644
--- a/arch/x86/kernel/cpu/mcheck/mce-inject.c
+++ b/arch/x86/kernel/cpu/mcheck/mce-inject.c
@@ -98,8 +98,9 @@ static struct notifier_block mce_raise_nb = {
 };
 
 /* Inject mce on current CPU */
-static int raise_local(struct mce *m)
+static int raise_local(void)
 {
+	struct mce *m = &__get_cpu_var(injectm);
 	int context = MCJ_CTX(m->inject_flags);
 	int ret = 0;
 	int cpu = m->extcpu;
@@ -167,12 +168,12 @@ static void raise_mce(struct mce *m)
 			}
 			cpu_relax();
 		}
-		raise_local(m);
+		raise_local();
 		put_cpu();
 		put_online_cpus();
 	} else
 #endif
-		raise_local(m);
+		raise_local();
 }
 
 /* Error injection interface */
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ