drm/amdgpu: Prevent random memory access in FRU code
authorLuben Tuikov <luben.tuikov@amd.com>
Fri, 4 Feb 2022 00:48:24 +0000 (19:48 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 7 Feb 2022 22:59:53 +0000 (17:59 -0500)
commit00b14ce075732edb2935d738de990e9aa96f1e08
treebd3a56dd6d03658ee1cbe806bd3cf5ac91055cca
parent3f3a24a0a3a58677d2b4f3c442d7a1be05afb123
drm/amdgpu: Prevent random memory access in FRU code

Prevent random memory access in the FRU EEPROM code by passing the size of
the destination buffer to the reading routine, and reading no more than the
size of the buffer.

Cc: Kent Russell <kent.russell@amd.com>
Cc: Alex Deucher <Alexander.Deucher@amd.com>
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
Acked-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com>
Reviewed-by: Kent Russell <kent.russell@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c