Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp17923468ybl; Thu, 2 Jan 2020 14:54:23 -0800 (PST) X-Google-Smtp-Source: APXvYqwDhm1l0MZCCcNQG98SvhdxWe7DZqLoHkb33cm+XLAIAZbeA0c/imHVgfVoSXk22h9P53VJ X-Received: by 2002:a05:6830:12da:: with SMTP id a26mr71540957otq.223.1578005663435; Thu, 02 Jan 2020 14:54:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578005663; cv=none; d=google.com; s=arc-20160816; b=ocXU6lXkgxEknIl9JQLu8xU6Q7PoDBXKDYmEprnhlJbeqdUhjSuKLW9KQOqeiYfvTA D7KAN93r63zf0op+G22xThDR8ajeunBwc22EOsDMm9NeiUkZFZIuPAKkwT6JMOmFrJob KYskgZB2s1DwGkGyYtqsMbDm0/JRAhP0csCQbnsqE2mBNp9qXgacm6FLxCIsnfzEcuUs LFqgVbvp/oLtCJWk3EC87YF31FIDKkuXSWB04AFb1gnmTIMwuNcm70j3J3AOlF+roZHB CDKT2Q3tjqQ9gvjTjTKsoPSE/UJS2X9sbiLr672PyRObibGAZr88BjV+//kkI2KEfWXF 5V2Q== 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=qzHO0QOmdPxEtP4EAN0ECyCn7xmOXgp6ZaFsbCtiH8M=; b=YmQKGlMPieZXgn9igdxjDV+CiRW8v6Wtt1t2xiXx5eN0qW3E+/4aBrn0fIch1TFOEE s6No4E1Dx6Bt8PS1uC6M5bgwhZymg2le56VCKVzLOdMIg8ptUB/K5DXXqwQZzcpg+lee +c06FfUBoQYJHZ7K2EjXrhIRKPl7iglx4Duy1efH2d6/g092gLl9lPQMaPeYWsssxlMR j1uUc0CeuilfIrTmoAiJVVp8hxJ/w+H7TaboXcY80ti3cdD50LKd5QHkpt6ZHppJuDuV F8irUi8y7/d/XfPCC8gt1UtizpbaZqLjyCve/VkcfHT5jLF4+5cChSZKjiShDhLWZLr6 kAag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=YumHkAEo; 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 n8si26771998otr.102.2020.01.02.14.54.12; Thu, 02 Jan 2020 14:54:23 -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=YumHkAEo; 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 S1728711AbgABWWP (ORCPT + 99 others); Thu, 2 Jan 2020 17:22:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:42404 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729102AbgABWWN (ORCPT ); Thu, 2 Jan 2020 17:22:13 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 501D3227BF; Thu, 2 Jan 2020 22:22:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578003732; bh=SMEJehBrbJjrA45F280FcI6aUeAE4KdjaoDeYzWp3+0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YumHkAEo0smUq3IAGrV2tITj/44sV/lRKNnJaRCYG50mJ3QRYI1J/80fEhYQMLef1 C5NL6E5r7OSPz4sM15HedZbz4hVlXK1S9Sd9SVYpnpesBXH0s7pNAPA0qb6PF3oe++ iu5EEisWVcVOxLEtgjqN5BLW2M8wXi9b4kbjlkbA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "=?UTF-8?q?Jan=20H . =20Sch=C3=B6nherr?=" , Borislav Petkov , Tony Luck , "H. Peter Anvin" , Ingo Molnar , linux-edac , Thomas Gleixner , x86-ml , Yazen Ghannam , Sasha Levin Subject: [PATCH 4.19 074/114] x86/mce: Fix possibly incorrect severity calculation on AMD Date: Thu, 2 Jan 2020 23:07:26 +0100 Message-Id: <20200102220036.554952288@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200102220029.183913184@linuxfoundation.org> References: <20200102220029.183913184@linuxfoundation.org> User-Agent: quilt/0.66 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 From: Jan H. Schönherr [ Upstream commit a3a57ddad061acc90bef39635caf2b2330ce8f21 ] The function mce_severity_amd_smca() requires m->bank to be initialized for correct operation. Fix the one case, where mce_severity() is called without doing so. Fixes: 6bda529ec42e ("x86/mce: Grade uncorrected errors for SMCA-enabled systems") Fixes: d28af26faa0b ("x86/MCE: Initialize mce.bank in the case of a fatal error in mce_no_way_out()") Signed-off-by: Jan H. Schönherr Signed-off-by: Borislav Petkov Reviewed-by: Tony Luck Cc: "H. Peter Anvin" Cc: Ingo Molnar Cc: linux-edac Cc: Cc: Thomas Gleixner Cc: x86-ml Cc: Yazen Ghannam Link: https://lkml.kernel.org/r/20191210000733.17979-4-jschoenh@amazon.de Signed-off-by: Sasha Levin --- arch/x86/kernel/cpu/mcheck/mce.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index 87ed8462a5c7..1f69b12d5bb8 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c @@ -812,8 +812,8 @@ static int mce_no_way_out(struct mce *m, char **msg, unsigned long *validp, if (quirk_no_way_out) quirk_no_way_out(i, m, regs); + m->bank = i; if (mce_severity(m, mca_cfg.tolerant, &tmp, true) >= MCE_PANIC_SEVERITY) { - m->bank = i; mce_read_aux(m, i); *msg = tmp; return 1; -- 2.20.1