From: Mario Limonciello Date: Wed, 4 Oct 2023 20:22:53 +0000 (-0500) Subject: drm/radeon: Fix UBSAN array-index-out-of-bounds for Radeon HD 5430 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c63079c61177ba1b17fa05c6875699a36924fe39;p=linux.git drm/radeon: Fix UBSAN array-index-out-of-bounds for Radeon HD 5430 For pptable structs that use flexible array sizes, use flexible arrays. Suggested-by: Felix Held Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2894 Signed-off-by: Mario Limonciello Acked-by: Alex Deucher Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/radeon/pptable.h b/drivers/gpu/drm/radeon/pptable.h index 4c2eec49dadc..94947229888b 100644 --- a/drivers/gpu/drm/radeon/pptable.h +++ b/drivers/gpu/drm/radeon/pptable.h @@ -74,7 +74,7 @@ typedef struct _ATOM_PPLIB_THERMALCONTROLLER typedef struct _ATOM_PPLIB_STATE { UCHAR ucNonClockStateIndex; - UCHAR ucClockStateIndices[1]; // variable-sized + UCHAR ucClockStateIndices[]; // variable-sized } ATOM_PPLIB_STATE;