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=1796389268; b=Q9C9B+trLB7AYeS1IqIEdwjvsX8I9pS2E4a0P3jqt/OUpenChMs2Ora8BQJ+hw9kue/H TBY1m/09HNB0iRNHUvjk3ieix90xv3ox+6wvuR538rDp2Tuqg6WqCbFSYVuCePoemolAJ 7xK+z2pf/8Ot6n9kGgXHPhJtZkXAOTMQGv0IHqXhP3jgKUfI4gzoWjPdIsyaHKwtuNTeE 68hUg1pDI+p2RhIbaxSfMeD8iaFmvz5IkA5I6tpg4rAEa+IPNrREXM1LryghtGOIhyhSs g/dQoo+3mTfZuX5oFefxFHBLdrcXirWbuRgeicv6BmRA+u8AnKTg+y3jarLuRYGixzA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796389268; 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=dDmTQXGV2kg3bIKHRbHsoCL2ItKbOD7z8wKSDWkprEQ=; b=dNAzU8crH9XMYReS7ecxi6r/94Ce8JK1QTwPrZO03t4kWNuC9vDhgf7EDDBBLK9UceoW lUAd3lWfdd/0zldzr58973mdKgF3tKOhIPc2NbsOEDkaG1Jg27CAqnFiZLxQt9qg2woBF +FEB093lyUlQGNeSJf54P0mrWGPeT4BaG9xdUu0nFAqqGDGNeN1RCZjSgcZKYUt6zEZFa zL7Dfb9pMkbAN7P3oP1RtEick+5YyhDGEqOSmH19GoHdQDf5pJf/kkyGEfdYI/fDgs5uQ 8iq9RVVdKFrT+17HLu8uzBJMAjv+OCblHrP39UvBDyZ2mjQsAVUgNkVmtV6rUQRppYg== 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=QyLevjIP; 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 F129F606A322; Fri, 4 Dec 2026 13:01:07 +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=QyLevjIP Received: by smtp.kernel.org (Postfix) with ESMTPSA id 345EB1F0092C; Fri, 4 Dec 2026 13:01:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1796389267; bh=dDmTQXGV2kg3bIKHRbHsoCL2ItKbOD7z8wKSDWkprEQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=QyLevjIPquHjPYfI60ZEnkaFT9MVw5UT8vJkTI936EliHKVJjjiQyVbuW2vG4qyBk T+WL0M7dZ45Tbht4uYhnyL5sjSc8fJCr3ihDXLIYuw03KmAMNDUqni2YPmLIzR4sSt YtC5a3D/C/qEtEo4I+3OUVfWTh30tfniQPi7nW34= 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 6.1 0926/1059] EDAC/i5000: Fix slot number passed to determine_mtr() Date: Fri, 4 Dec 2026 19:07:37 +0900 Message-ID: <20261204100708.009720095@linuxfoundation.org> X-Mailer: git-send-email 2.56.1 In-Reply-To: <20261204100643.980430235@linuxfoundation.org> References: <20261204100643.980430235@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-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 @@ -1250,14 +1250,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 */ @@ -1268,7 +1266,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);