All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/amdgpu: Increase HWIP_MAX_INSTANCE to 10
@ 2021-09-02  7:50 Ernst Sjöstrand
  2021-09-02 16:16 ` Alex Deucher
  0 siblings, 1 reply; 3+ messages in thread
From: Ernst Sjöstrand @ 2021-09-02  7:50 UTC (permalink / raw)
  To: amd-gfx

Seems like newer cards can have even more instances now.
Found by UBSAN: array-index-out-of-bounds in
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:318:29
index 8 is out of range for type 'uint32_t *[8]'

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1697
Cc: stable@vger.kernel.org
Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index dc3c6b3a00e5..d356e329e6f8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -758,7 +758,7 @@ enum amd_hw_ip_block_type {
 	MAX_HWIP
 };
 
-#define HWIP_MAX_INSTANCE	8
+#define HWIP_MAX_INSTANCE	10
 
 struct amd_powerplay {
 	void *pp_handle;
-- 
2.30.2


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

* Re: [PATCH] drm/amd/amdgpu: Increase HWIP_MAX_INSTANCE to 10
  2021-09-02  7:50 [PATCH] drm/amd/amdgpu: Increase HWIP_MAX_INSTANCE to 10 Ernst Sjöstrand
@ 2021-09-02 16:16 ` Alex Deucher
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Deucher @ 2021-09-02 16:16 UTC (permalink / raw)
  To: Ernst Sjöstrand; +Cc: amd-gfx list

Applied.  Thanks!

Alex

On Thu, Sep 2, 2021 at 3:50 AM Ernst Sjöstrand <ernstp@gmail.com> wrote:
>
> Seems like newer cards can have even more instances now.
> Found by UBSAN: array-index-out-of-bounds in
> drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:318:29
> index 8 is out of range for type 'uint32_t *[8]'
>
> Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1697
> Cc: stable@vger.kernel.org
> Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index dc3c6b3a00e5..d356e329e6f8 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -758,7 +758,7 @@ enum amd_hw_ip_block_type {
>         MAX_HWIP
>  };
>
> -#define HWIP_MAX_INSTANCE      8
> +#define HWIP_MAX_INSTANCE      10
>
>  struct amd_powerplay {
>         void *pp_handle;
> --
> 2.30.2
>

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

* [PATCH] drm/amd/amdgpu: Increase HWIP_MAX_INSTANCE to 10
@ 2021-09-02  7:47 Ernst Sjöstrand
  0 siblings, 0 replies; 3+ messages in thread
From: Ernst Sjöstrand @ 2021-09-02  7:47 UTC (permalink / raw)
  To: ernstp; +Cc: stable

Seems like newer cards can have even more instances now.
Found by UBSAN: array-index-out-of-bounds in
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c:318:29
index 8 is out of range for type 'uint32_t *[8]'

Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/1697
Cc: stable@vger.kernel.org
Signed-off-by: Ernst Sjöstrand <ernstp@gmail.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index dc3c6b3a00e5..d356e329e6f8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -758,7 +758,7 @@ enum amd_hw_ip_block_type {
 	MAX_HWIP
 };
 
-#define HWIP_MAX_INSTANCE	8
+#define HWIP_MAX_INSTANCE	10
 
 struct amd_powerplay {
 	void *pp_handle;
-- 
2.30.2


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

end of thread, other threads:[~2021-09-02 16:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-02  7:50 [PATCH] drm/amd/amdgpu: Increase HWIP_MAX_INSTANCE to 10 Ernst Sjöstrand
2021-09-02 16:16 ` Alex Deucher
  -- strict thread matches above, loose matches on Subject: below --
2021-09-02  7:47 Ernst Sjöstrand

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.