drm/amdgpu: fix out of bounds memcpy
Subsystems (2)
PATCH 1/1 drm/amdgpu: fix out of bounds memcpy
The buffer needs to be two bytes larger when the maximum is 32.
Signed-off-by Christian König <[email protected]>
--- drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +1 -1
@@ -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))
Signature · 6 lines
2.17.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 3 lines · Christian König
The buffer needs to be two bytes larger when the maximum is 32.
Signed-off-by Christian König <[email protected]>
Acked-by Nirmoy Das <[email protected]>
Quoted 9 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +0
-0
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c int amdgpu_fru_read_eeprom(struct amdgpu_device *adev, uint32_t addrptr, · line 91
Quoted 8 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +1
-1@@ -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))
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx