drm/radeon: Fix UBSAN array-index-out-of-bounds for Radeon HD 5430
authorMario Limonciello <mario.limonciello@amd.com>
Wed, 4 Oct 2023 20:22:53 +0000 (15:22 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 9 Oct 2023 20:47:08 +0000 (16:47 -0400)
For pptable structs that use flexible array sizes, use flexible arrays.

Suggested-by: Felix Held <felix.held@amd.com>
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2894
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
Acked-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/pptable.h

index 4c2eec49dadc93427bd54336daf4ee0d410fdcc4..94947229888ba7888aa6992116af8ab985219dbe 100644 (file)
@@ -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;