All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amdkfd: Fix the memory overrun
@ 2022-11-07  7:08 Ma Jun
  2022-11-07 14:32 ` Felix Kuehling
  2022-11-18 23:32 ` Kees Cook
  0 siblings, 2 replies; 3+ messages in thread
From: Ma Jun @ 2022-11-07  7:08 UTC (permalink / raw)
  To: amd-gfx, felix.kuehling, alexander.deucher, keescook; +Cc: guchun.chen

Fix the memory overrun issue caused by wrong array size.

Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
Addresses-Coverity-ID: 1527133 ("Memory - corruptions")
Fixes: 6246000093863 ("drm/amdkfd: Fix the warning of array-index-out-of-bounds")
---
 drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
index 7029e3bdff3e..6e81f50ad912 100644
--- 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(struct crat_subtype_cache *cache,
 			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;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdkfd: Fix the memory overrun
  2022-11-07  7:08 [PATCH] drm/amdkfd: Fix the memory overrun Ma Jun
@ 2022-11-07 14:32 ` Felix Kuehling
  2022-11-18 23:32 ` Kees Cook
  1 sibling, 0 replies; 3+ messages in thread
From: Felix Kuehling @ 2022-11-07 14:32 UTC (permalink / raw)
  To: Ma Jun, amd-gfx, alexander.deucher, keescook; +Cc: guchun.chen

Am 2022-11-07 um 02:08 schrieb Ma Jun:
> Fix the memory overrun issue caused by wrong array size.
>
> Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
> Reported-by: coverity-bot <keescook+coverity-bot@chromium.org>
> Addresses-Coverity-ID: 1527133 ("Memory - corruptions")
> Fixes: 6246000093863 ("drm/amdkfd: Fix the warning of array-index-out-of-bounds")

Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>


> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_crat.c b/drivers/gpu/drm/amd/amdkfd/kfd_crat.c
> index 7029e3bdff3e..6e81f50ad912 100644
> --- 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(struct crat_subtype_cache *cache,
>   			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;

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/amdkfd: Fix the memory overrun
  2022-11-07  7:08 [PATCH] drm/amdkfd: Fix the memory overrun Ma Jun
  2022-11-07 14:32 ` Felix Kuehling
@ 2022-11-18 23:32 ` Kees Cook
  1 sibling, 0 replies; 3+ messages in thread
From: Kees Cook @ 2022-11-18 23:32 UTC (permalink / raw)
  To: Ma Jun; +Cc: alexander.deucher, felix.kuehling, guchun.chen, amd-gfx

On Mon, Nov 07, 2022 at 03:08:06PM +0800, Ma Jun wrote:
> Fix the memory overrun issue caused by wrong array size.
> 
> Signed-off-by: Ma Jun <Jun.Ma2@amd.com>

Reviewed-by: Kees Cook <keescook@chromium.org>

-- 
Kees Cook

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-19 13:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-07  7:08 [PATCH] drm/amdkfd: Fix the memory overrun Ma Jun
2022-11-07 14:32 ` Felix Kuehling
2022-11-18 23:32 ` Kees Cook

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.