Re: [PATCH 1/3] drm/amdgpu/si: Fix buffer overflow in si_get_register_value()

2020-08-25 Thread Dan Carpenter
On Tue, Aug 25, 2020 at 11:53:25AM -0400, Alex Deucher wrote: > On Tue, Aug 25, 2020 at 7:21 AM Dan Carpenter > wrote: > > > > The values for "se_num" and "sh_num" come from the user in the ioctl. > > They can be in the 0-255 range but if they're more than > > AMDGPU_GFX_MAX_SE (4) or

Re: [PATCH 1/3] drm/amdgpu/si: Fix buffer overflow in si_get_register_value()

2020-08-25 Thread Alex Deucher
On Tue, Aug 25, 2020 at 7:21 AM Dan Carpenter wrote: > > The values for "se_num" and "sh_num" come from the user in the ioctl. > They can be in the 0-255 range but if they're more than > AMDGPU_GFX_MAX_SE (4) or AMDGPU_GFX_MAX_SH_PER_SE (2) then it results in > an out of bounds read. > > I split

[PATCH 1/3] drm/amdgpu/si: Fix buffer overflow in si_get_register_value()

2020-08-25 Thread Dan Carpenter
The values for "se_num" and "sh_num" come from the user in the ioctl. They can be in the 0-255 range but if they're more than AMDGPU_GFX_MAX_SE (4) or AMDGPU_GFX_MAX_SH_PER_SE (2) then it results in an out of bounds read. I split this function into to two to make the error handling simpler.