linux-edac.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] x86/mce: Check that memory address is usable for recovery
@ 2023-03-22  0:51 Tony Luck
  2023-04-18 16:41 ` Yazen Ghannam
  0 siblings, 1 reply; 9+ messages in thread
From: Tony Luck @ 2023-03-22  0:51 UTC (permalink / raw)
  To: Borislav Petkov; +Cc: x86, linux-kernel, linux-edac, patches, Tony Luck

uc_decode_notifier() includes a check that "struct mce"
contains a valid address for recovery. But the machine
check recovery code does not include a similar check.

Use mce_usable_address() to check that there is a valid
address.

Signed-off-by: Tony Luck <tony.luck@intel.com>
---
 arch/x86/kernel/cpu/mce/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index 2eec60f50057..fa28b3f7d945 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -1533,7 +1533,7 @@ noinstr void do_machine_check(struct pt_regs *regs)
 		/* If this triggers there is no way to recover. Die hard. */
 		BUG_ON(!on_thread_stack() || !user_mode(regs));
 
-		if (kill_current_task)
+		if (kill_current_task || !mce_usable_address(&m))
 			queue_task_work(&m, msg, kill_me_now);
 		else
 			queue_task_work(&m, msg, kill_me_maybe);
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2023-04-19 13:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-22  0:51 [PATCH] x86/mce: Check that memory address is usable for recovery Tony Luck
2023-04-18 16:41 ` Yazen Ghannam
2023-04-18 17:27   ` Tony Luck
2023-04-18 17:51     ` Yazen Ghannam
2023-04-18 18:23       ` Tony Luck
2023-04-18 18:03   ` [PATCH v2] x86/mce: Always call memory_failure() when there is a valid address Tony Luck
2023-04-18 18:17     ` Yazen Ghannam
2023-04-18 19:34       ` Luck, Tony
2023-04-19 13:08         ` Yazen Ghannam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).