Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2745454imj; Mon, 11 Feb 2019 07:52:35 -0800 (PST) X-Google-Smtp-Source: AHgI3Ibn2a15SEXG58bfk+B2ty+bOqz2Sy5wiZM2IIQzqVNPtDCw8DPVEU5tWDJxhRh8qAp7/1i9 X-Received: by 2002:a63:7909:: with SMTP id u9mr8317264pgc.243.1549900355733; Mon, 11 Feb 2019 07:52:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549900355; cv=none; d=google.com; s=arc-20160816; b=WdPc+kLiZuUoVAnhTFdTLSWun9hWdppjlkHHU3AXs60GI+5kBKXrtppnWjqBd1Hppl wsfNmfsBgoUkbV4ee/ZtARlR/3BpcEB4h6CcTTTE4l7i78hKkcTo20A4KvgHbrzikn6p gWnIkTU5dzmjqwUf+6lgxCtb3awbu9c5L3muduTuJr7bd2MS4BT1uju9CyJEFfGp/xHM W5jFw6Xv826iEMH0pjYMkwx0Y5XkVGCpXLtkJFTIrUP0hzu1cy1b+fXyO/lI3TOtHRO+ ztiMAySDhXx4zDnNifJVTdy8H2NvH5uWcbp+Whq15RdUu1eYJbWwuWavc22pdOmk5hj9 lD7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=sKStVLAXTxvpeCYLUijIHy9mGUKjdp3ggXp4MnawQ1Q=; b=TCGKDlJYOjjgy2XNGNicOhG3tKQsTHAW51dKt2SD/JSSKXH9MQljIizzcTmsqSxVDW urrdf2wWL0QYDn5OPWgkMnYfJYGEm5pkHFrcjZ2mHckghUUm3c/Npa8QCXGcHJe00BCp VKO8XM6gHTW9+TXDZjD9afeEytIGW5WDiaJCS8SRwcoBODJmqZbbnewMckT+wPDIVyh+ tpNr8j9wAn9Sq3iYS6w9CxTHfTwEfOZ9bRuQBzayW/qzHBkzncF9rlyouNSTN3WrBj8D +RVigeTiqnedBjrHngE0iAXqqhs8HWkmeUP4/8fvjwXA0+OMnrug06soKbG9VYa6R1dd Yqug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CET8iEKv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p11si10289447plk.191.2019.02.11.07.52.18; Mon, 11 Feb 2019 07:52:35 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CET8iEKv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731668AbfBKPv0 (ORCPT + 99 others); Mon, 11 Feb 2019 10:51:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:47772 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731596AbfBKOiJ (ORCPT ); Mon, 11 Feb 2019 09:38:09 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 93DC02081B; Mon, 11 Feb 2019 14:38:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549895889; bh=isYRB4vcDV+9G1nICICJGjLx4sPd8oGv+q0tWbOF/uY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CET8iEKvuUuj3y4m6p6ynn0stXl2kY88md2XNQ2vuQvNtMZl/3YEJNA3omyZIZ3gy fRwH5hVt9ZyFJqOeLpTKcKHbFXk1OAkkM4E2N8mNet/EZhaOI9HSAveEUFwh1yJDkE DGXT4bc8S+Tbz5Fm5mAABaRlH4gBVFap/Pdoucx4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tony Luck , Borislav Petkov , "H. Peter Anvin" , Ingo Molnar , Thomas Gleixner , Vishal Verma , x86-ml Subject: [PATCH 4.20 345/352] x86/MCE: Initialize mce.bank in the case of a fatal error in mce_no_way_out() Date: Mon, 11 Feb 2019 15:19:32 +0100 Message-Id: <20190211141909.130188752@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141846.543045703@linuxfoundation.org> References: <20190211141846.543045703@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.20-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tony Luck commit d28af26faa0b1daf3c692603d46bc4687c16f19e upstream. Internal injection testing crashed with a console log that said: mce: [Hardware Error]: CPU 7: Machine Check Exception: f Bank 0: bd80000000100134 This caused a lot of head scratching because the MCACOD (bits 15:0) of that status is a signature from an L1 data cache error. But Linux says that it found it in "Bank 0", which on this model CPU only reports L1 instruction cache errors. The answer was that Linux doesn't initialize "m->bank" in the case that it finds a fatal error in the mce_no_way_out() pre-scan of banks. If this was a local machine check, then this partially initialized struct mce is being passed to mce_panic(). Fix is simple: just initialize m->bank in the case of a fatal error. Fixes: 40c36e2741d7 ("x86/mce: Fix incorrect "Machine check from unknown source" message") Signed-off-by: Tony Luck Signed-off-by: Borislav Petkov Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: Thomas Gleixner Cc: Vishal Verma Cc: x86-ml Cc: stable@vger.kernel.org # v4.18 Note pre-v5.0 arch/x86/kernel/cpu/mce/core.c was called arch/x86/kernel/cpu/mcheck/mce.c Link: https://lkml.kernel.org/r/20190201003341.10638-1-tony.luck@intel.com Signed-off-by: Greg Kroah-Hartman --- arch/x86/kernel/cpu/mcheck/mce.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -786,6 +786,7 @@ static int mce_no_way_out(struct mce *m, quirk_no_way_out(i, m, regs); if (mce_severity(m, mca_cfg.tolerant, &tmp, true) >= MCE_PANIC_SEVERITY) { + m->bank = i; mce_read_aux(m, i); *msg = tmp; return 1;