Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2690557imj; Mon, 11 Feb 2019 07:05:00 -0800 (PST) X-Google-Smtp-Source: AHgI3IaxWAi2BtfC0wI7x2lTvHqsmM+NKfm0VxRwK/il4xu6L4wCEiE0j8csO/x25JuN2XPkGDdX X-Received: by 2002:a17:902:7044:: with SMTP id h4mr37865514plt.35.1549897500135; Mon, 11 Feb 2019 07:05:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549897500; cv=none; d=google.com; s=arc-20160816; b=F6x0S1j4xaKrM07HGbDPSAZ6kpWspyLJ14ebln9ZuUV1k2w92pQsVL1mop2J+pvc92 6YgFQ42ZmW91d4f0CJx4xD+ND9TtcqkdwwEmIB0uzOfPuDwcyJ+FZ9d24nJcXZnBeZNz czMOh+r5hpQt7/B7xhmx35gftYY0zx+fpJLHcGmLf/VCTfNNTjnuZaSN640M1Yr6QHo3 IJ6+StBmXnz38nJi9++EMC/OMenHM7ea9z53aH18AyX5RFWm2qLQclnWYsn0CRSUTveM 7lwvaJwJx6N+jLouvWMBAXsAzmfsBOAiLXzCMvWlUaZ2LD6qIUOu7HzSeIaELedErKWR 5iDg== 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=A5EQ4pWK7zWdfSrTMiScAx/OGz1PB7w/XON4U5D+dDs=; b=vsflBvsLp9v1ScUfu9e6Rkk3bgDKgbz7d9TeB2ctP84FWneCmkAc72Ksy9Y80DpV87 pScMCR9tTb/9GhlEOlOefGF2cSQghUhrMwQyNk5RJkZ8PQvn3GiGpSWd2ssrCYZJPiGx MkXI9VM5bVz0BIQniKIMJBCHr463pFSdAiCa8aBoZHmTGRe09pNX8O2hty8IR8vGsWva Y/49OSABobB6V52onl5Ttnr42Gjwq/FX7fSzu3VkkaXjwr0vGfWqjtg1HDipAuhMWfvv LARU+txATtcNmkL6F2p8HeZwitml+AGgc3HAniPn0Sm606NbeK4ILlBGRxOTuxkBrgp3 zuTw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hj+Ypykf; 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 u7si11523424pfu.270.2019.02.11.07.04.41; Mon, 11 Feb 2019 07:05:00 -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=hj+Ypykf; 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 S2390667AbfBKPDm (ORCPT + 99 others); Mon, 11 Feb 2019 10:03:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:52338 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390660AbfBKPDi (ORCPT ); Mon, 11 Feb 2019 10:03:38 -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 9CD11222A7; Mon, 11 Feb 2019 15:03:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549897418; bh=TBYFs7S8buC+UPKaNBQMT6mHfwE90Kw/LD2ReAafBGY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hj+YpykfyEpAsCGF41uyISyggGm9T/k2JL+EwC2UEMnyfIcSaJJ6zP1JRGyF7jJYx qBmLvBK/+J8kC9kxdvF6KynTNdkLC1L+nGkN/cpE7UDEcF1sD40RibHe4iwH9XnkR8 7otJ1kMNSETTaxiHGkW7jC6eCBQsKVh095muB73Y= 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.14 197/205] x86/MCE: Initialize mce.bank in the case of a fatal error in mce_no_way_out() Date: Mon, 11 Feb 2019 15:19:55 +0100 Message-Id: <20190211141841.312127112@linuxfoundation.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190211141827.214852402@linuxfoundation.org> References: <20190211141827.214852402@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.14-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 @@ -773,6 +773,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;