Received: by 10.223.185.116 with SMTP id b49csp5448623wrg; Wed, 7 Mar 2018 11:57:50 -0800 (PST) X-Google-Smtp-Source: AG47ELsqZWGqpfOFJNzyeW+iJZqdUoJlM9OpvIv3iIMzsIG+5euUp4JB056dgh+ukvicLiFp+kKa X-Received: by 10.101.96.43 with SMTP id p11mr19052422pgu.430.1520452670735; Wed, 07 Mar 2018 11:57:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520452670; cv=none; d=google.com; s=arc-20160816; b=h8EJawhADxHjbo6wMXgNGybzQz7f27X5At7kxmNkBF6O91gXgkSLsz6iH41CPuAqkP W4oKtB3A9CadB+TAZm1GBPDQ31eNW9dHZ4P6ydrBa096oE8kwPlnPGcRIMJsJUCScB49 qNDiMbVGlwVtGGG18AG+s+Lbh90VskwRJwSObGicyhiwW/8TnBgZ7iQbkwYKZ9QnepV7 pailwT5JATYjQ3Z1ngFBvNMasvgKQCdXDQkeSp4wqC2Ue0/qKv44wojRJhdXR4hCFGBw ebrvdktxKejpOethX2H85NTjja6OYdYmMfa8lts/ajyrkekOoDQDBvOahcKZ5hZoLfs7 huFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Fp1ZZnoL6vFLX0oL2jhe/Wuai+jMNgj/LQv0lre36Cg=; b=Vi6yy/sbFTG4eWA2msVBSlm9SKvl9Yfl40gtX6gf4e3qE1JiNkp0wyCo/0Ifx/Apgs RoTUYVRfb0R23QI+kwVcvvL/7T8FbWpcy/cOV4W9csund4fFf/uulLHA7YKsQkhUDbFb QRWxAUs9p+E7GIZBj+mVfmgYZoJ3+CSWeY1rZCIQIG1Vcm5gm9t3Ps8Ud9fy+STAQ2nm rqjt5Kq/4gTosYjQOZfJw/zICzgc6snViKXcuBvN6ZbzVE5eWnq/Dc+kLLZQ3o1ICxA2 Sz+1CYzsxPfGijVo52PEv+yCICqljluFUhJ4KnR5Gh47LLo0BJZTe/pi5rEl9MGZ79oY sqRA== ARC-Authentication-Results: i=1; mx.google.com; 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 w24-v6si13110229plq.553.2018.03.07.11.57.36; Wed, 07 Mar 2018 11:57:50 -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; 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 S935179AbeCGT4r (ORCPT + 99 others); Wed, 7 Mar 2018 14:56:47 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:44986 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935046AbeCGTr0 (ORCPT ); Wed, 7 Mar 2018 14:47:26 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 3EF2A10DE; Wed, 7 Mar 2018 19:47:25 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Anna Karbownik , Mauro Carvalho Chehab , Tony Luck , jim.m.snow@intel.com, krzysztof.paliswiat@intel.com, lukasz.odzioba@intel.com, qiuxu.zhuo@intel.com, linux-edac , Borislav Petkov Subject: [PATCH 4.14 085/110] EDAC, sb_edac: Fix out of bound writes during DIMM configuration on KNL Date: Wed, 7 Mar 2018 11:39:08 -0800 Message-Id: <20180307191050.728230640@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307191039.748351103@linuxfoundation.org> References: <20180307191039.748351103@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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: Anna Karbownik commit bf8486709ac7fad99e4040dea73fe466c57a4ae1 upstream. Commit 3286d3eb906c ("EDAC, sb_edac: Drop NUM_CHANNELS from 8 back to 4") decreased NUM_CHANNELS from 8 to 4, but this is not enough for Knights Landing which supports up to 6 channels. This caused out-of-bounds writes to pvt->mirror_mode and pvt->tolm variables which don't pay critical role on KNL code path, so the memory corruption wasn't causing any visible driver failures. The easiest way of fixing it is to change NUM_CHANNELS to 6. Do that. An alternative solution would be to restructure the KNL part of the driver to 2MC/3channel representation. Reported-by: Dan Carpenter Signed-off-by: Anna Karbownik Cc: Mauro Carvalho Chehab Cc: Tony Luck Cc: jim.m.snow@intel.com Cc: krzysztof.paliswiat@intel.com Cc: lukasz.odzioba@intel.com Cc: qiuxu.zhuo@intel.com Cc: linux-edac Cc: Fixes: 3286d3eb906c ("EDAC, sb_edac: Drop NUM_CHANNELS from 8 back to 4") Link: http://lkml.kernel.org/r/1519312693-4789-1-git-send-email-anna.karbownik@intel.com [ Massage commit message. ] Signed-off-by: Borislav Petkov Signed-off-by: Greg Kroah-Hartman --- drivers/edac/sb_edac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/edac/sb_edac.c +++ b/drivers/edac/sb_edac.c @@ -279,7 +279,7 @@ static const u32 correrrthrsld[] = { * sbridge structs */ -#define NUM_CHANNELS 4 /* Max channels per MC */ +#define NUM_CHANNELS 6 /* Max channels per MC */ #define MAX_DIMMS 3 /* Max DIMMS per channel */ #define KNL_MAX_CHAS 38 /* KNL max num. of Cache Home Agents */ #define KNL_MAX_CHANNELS 6 /* KNL max num. of PCI channels */