From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ECA02C6FD18 for ; Tue, 28 Mar 2023 15:06:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233867AbjC1PGc (ORCPT ); Tue, 28 Mar 2023 11:06:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233871AbjC1PGb (ORCPT ); Tue, 28 Mar 2023 11:06:31 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 75DF7EB65 for ; Tue, 28 Mar 2023 08:05:19 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id DC00DB81D81 for ; Tue, 28 Mar 2023 15:05:18 +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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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;