From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CED488BE0 for ; Tue, 28 Mar 2023 15:05:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53F6FC433EF; Tue, 28 Mar 2023 15:05:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1680015917; bh=rgbxGXgtBGzX2TXTlLFoE5MhmnQh0pJ0IQKb8hN1d8I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xTcgmqzr1ptw77pTROlNIVwnPlItE3lxfy+dIbbEVrb27GpWw1qSCvfLcZfutqrFL wPCLP5xnhssHVo0UVcqP13H76OrWeY3vTOh9TUa6ZFFYU8wWHF6Z3KkrfOlZf03Ijh twaZ9x0b4qt54soJQowDAVBR72QyPC2f0mvGmcKw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Ma Jun , Felix Kuehling , coverity-bot , Alex Deucher Subject: [PATCH 6.1 224/224] drm/amdkfd: Fix the memory overrun Date: Tue, 28 Mar 2023 16:43:40 +0200 Message-Id: <20230328142626.610524578@linuxfoundation.org> X-Mailer: git-send-email 2.40.0 In-Reply-To: <20230328142617.205414124@linuxfoundation.org> References: <20230328142617.205414124@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Ma Jun commit 4cc16d64b6cdb179a26fb389cae9dce788e88f5d upstream. Fix the memory overrun issue caused by wrong array size. Signed-off-by: Ma Jun Reviewed-by: Felix Kuehling Reported-by: coverity-bot Addresses-Coverity-ID: 1527133 ("Memory - corruptions") Fixes: c0cc999f3c32e6 ("drm/amdkfd: Fix the warning of array-index-out-of-bounds") Signed-off-by: Alex Deucher Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c @@ -1111,7 +1111,7 @@ static int kfd_parse_subtype_cache(struc props->cache_latency = cache->cache_latency; memcpy(props->sibling_map, cache->sibling_map, - sizeof(props->sibling_map)); + CRAT_SIBLINGMAP_SIZE); /* set the sibling_map_size as 32 for CRAT from ACPI */ props->sibling_map_size = CRAT_SIBLINGMAP_SIZE;