[PATCH] drm/amdgpu: fix out of bounds memcpy
Christian König
ckoenig.leichtzumerken at gmail.com
Wed Apr 8 10:16:42 UTC 2020
The buffer needs to be two bytes larger when the maximum is 32.
Signed-off-by: Christian König <christian.koenig at amd.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c
index 9d17761721de..c7e55fe170bd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c
@@ -85,7 +85,7 @@ int amdgpu_fru_read_eeprom(struct amdgpu_device *adev, uint32_t addrptr,
int amdgpu_fru_get_product_info(struct amdgpu_device *adev)
{
- unsigned char buff[32];
+ unsigned char buff[34];
int addrptr = 0, size = 0;
if (!is_fru_eeprom_supported(adev))
--
2.17.1
More information about the amd-gfx
mailing list