From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796380864; b=y2h4IYOWIxe1W7FqIeLMsPyrCznMh1CsCKCRh7cQrVJnFLgVIqVDnapaSxtWTzj7g81+ mEGSsUK50ygb0xa1bsG4aaugEM3kgf/o2kMQ7LbYeS2ZhOg5p5TbypOC+IvK/yodUtq8B YQj7ibJ24YQ4seNn420VdfeX1AMUJKNlQzxGk7/PBVxmj9uyMV2qDl8WDUhfYxIEJlqS4 6p4csM82H8U9wqfP5O4h40ZvQ6Vo53Na6VYQEvZm2Fzlj7O49hEAWu7anCHIxyVW7SdkG FVfV9fM0O4ffrwyJjFJL7+iy14gMjMh75yCoMZa/55p1LwvLbmpOAp7dx4/VV3tcd7w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796380864; h=Received:DKIM-Signature:From:To:Cc:Subject:Date:Message-ID:X-Mailer: In-Reply-To:References:User-Agent:X-stable:X-Patchwork-Hint: MIME-Version:Content-Transfer-Encoding; bh=1iHFxKHSi1+ubwcPl6gADGofLqathYDregm7SWnz6DE=; b=yQ9c9aW0vLzuty0SHbKqldGiR9EDyeTJ6eB2S5I3QymoMx/CDcxwSz4AWRijzUe2Kt9e I4xg0bSfW+ttfi6+wqIBepWED3XwnZbphNs/TbQEp4uWZeHsNoVVcAy2UE8sYMlee6x08 QmuiBrjijDdfBHoHL4T6s14L7kW2tLr+OXMYWsYsfiFa3irDEM0oEvfD0xORasbP49WqM 1CFoazLDBO+TBtbIGC+W2+AglafOha8ldKJKVz5Zxj/b4dkRaG7PO3CqvTEcfGz63n44r XBvEOBLPTQtJYEbj+j/bFz4HA9vgVNh1osC+ns6I8IDhXL6eLKOLf/CDEhgj1d3TccA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=cI5gdv1t; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 7980C606A322; Fri, 4 Dec 2026 10:41:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.a=rsa-sha256 header.s=korg header.b=cI5gdv1t Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9061A1F000CE; Fri, 4 Dec 2026 10:41:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796380864; bh=1iHFxKHSi1+ubwcPl6gADGofLqathYDregm7SWnz6DE=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=cI5gdv1tP+lSxO2OsPwEwomOFT+QSKvrjWSYY2QAMLpN8g8TQVDnajNGUe5FHCNla zrQkAdUdt+H52VeoL4BItLTfMp9oe6IBiA8aoCbVgMLmn3U1lHD5vvHe2iJXN0a8vw V/cLjPcKnb3H6912jE85IMuzXWAF7xC3VsR+SpkU= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Aristeu Rozanski , Andrew Luebke , "Borislav Petkov (AMD)" Subject: [PATCH 7.3 458/742] EDAC/i5000: Fix slot number passed to determine_mtr() Date: Fri, 4 Dec 2026 19:05:22 +0900 Message-ID: <20261204100647.331632439@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100635.034361255@linuxfoundation.org> References: <20261204100635.034361255@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: patches@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Aristeu Rozanski commit a088b092a8962db62327690ae2d0d68827e81229 upstream. When the logic mapping branch/slot/channel was reworked back in 64e1fdaf55d6 ("i5000_edac: Fix the logic that retrieves memory information") i5000_init_csrows() was not updated and kept passing twice the number of slots to determine_mtr(), which leads to accessing past the end of i5000_pvt.b1_mtr[]. This was found by KASAN. Fixes: 64e1fdaf55d6 ("i5000_edac: Fix the logic that retrieves memory information") Signed-off-by: Aristeu Rozanski Signed-off-by: Andrew Luebke Signed-off-by: Borislav Petkov (AMD) Tested-by: Andrew Luebke Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/20220921181009.oxytvicy6sry6it7@redhat.com Signed-off-by: Greg Kroah-Hartman --- drivers/edac/i5000_edac.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) --- a/drivers/edac/i5000_edac.c +++ b/drivers/edac/i5000_edac.c @@ -1253,14 +1253,12 @@ static int i5000_init_csrows(struct mem_ struct i5000_pvt *pvt; struct dimm_info *dimm; int empty; - int max_csrows; int mtr; int csrow_megs; int channel; int slot; pvt = mci->pvt_info; - max_csrows = pvt->maxdimmperch * 2; empty = 1; /* Assume NO memory */ @@ -1271,7 +1269,7 @@ static int i5000_init_csrows(struct mem_ * to map the dimms. A good cleanup would be to remove this array, * and do a loop here with branch, channel, slot */ - for (slot = 0; slot < max_csrows; slot++) { + for (slot = 0; slot < pvt->maxdimmperch; slot++) { for (channel = 0; channel < pvt->maxch; channel++) { mtr = determine_mtr(pvt, slot, channel);