Received: by 10.223.185.116 with SMTP id b49csp5476298wrg; Wed, 7 Mar 2018 12:25:28 -0800 (PST) X-Google-Smtp-Source: AG47ELu16SgnNCFaFsht7PZo6tPutQSwLrCN2uVIoj35aXv1q8Y34/TwMoENtNYyfmadxD+eVmZc X-Received: by 2002:a17:902:6c47:: with SMTP id h7-v6mr11877649pln.445.1520454328051; Wed, 07 Mar 2018 12:25:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520454328; cv=none; d=google.com; s=arc-20160816; b=pMMh+y7kc47rrIAmznM9++8wPF3P0bjx/V2NntMYOzPxnothSb8E7Lxwm3CGR4+Kcc SCBmPuJyQpEcqHZ4AIjPSpzHVafus39ggr56LeYABBRxTnJK7OgdbFhxwl1R5DgMdPGc VMQwD4gHZmIPaKsXtdF0iN7mPHRnITIjN56IPIv/Q5kk1gS4Oc5UqZ1vpurHB44BZGR7 zoqk0iAcIvObl7YQQtWvOXUytO2UqpkFFZw7AwJZDNFn8fLAg8KSjTCAB9c/I5Jp95vG l1ld7qi7B/GRMjSAhvAlx7bN/7Uxs+ztjGXyUTgYO1mdWEeUMoMUKeHRnZl626qWlUdN OAbw== 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=TR3vbmIfRFS0WQodX+PQGNrmnvzRGLgvVbWejijQ79o=; b=Bzdmp3BVBx/8B+jxYPBMLGqbBETSTxfn8eCQbZKZ6VV0Y7wXEW2ahpdTvHThY4Rxkr U5XrNXZWT1BNVGAM3YqxWZS6zvA0a+5s9MiqPjeHtJWDtTtrnm6zfI7+40COnf+AHeVM Ya/s/hJxaSvn1FrxWBc6KMltoLbD8LCYeKmbCIHDtvMwFUni81YofvhD7JPduH7QoQiJ ZLBqLTqx22PAp+2W37gItXZi6qcioHJiMp96fA1NYVarWfS3TavSYmsKapxAcD5718vg 7sQdpE5YmCf3PDcaIlijbnWmk/rqbwwyzlw+U5ifzY0TKcQAoR7+KRsRhJy+PSQ541qK pwfw== 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 s72si3555849pgc.818.2018.03.07.12.25.13; Wed, 07 Mar 2018 12:25:28 -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 S964947AbeCGTn2 (ORCPT + 99 others); Wed, 7 Mar 2018 14:43:28 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:42798 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964929AbeCGTnX (ORCPT ); Wed, 7 Mar 2018 14:43:23 -0500 Received: from localhost (unknown [185.236.200.248]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id C22AB5AA; Wed, 7 Mar 2018 19:43:22 +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.15 100/122] EDAC, sb_edac: Fix out of bound writes during DIMM configuration on KNL Date: Wed, 7 Mar 2018 11:38:32 -0800 Message-Id: <20180307191743.848319164@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180307191729.190879024@linuxfoundation.org> References: <20180307191729.190879024@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.15-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 */