Re: [PATCH 4.19] Revert "drm/amdgpu: add missing size check in amdgpu_debugfs_gprwave_read()"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Dec 04, 2024 at 04:22:31PM +0800, Zhang Zekun wrote:
> This reverts commit 673bdb4200c092692f83b5f7ba3df57021d52d29.
> 
> The origin mainline patch fix a buffer overflow issue in
> amdgpu_debugfs_gprwave_read(), but it has not been introduced in kernel
> 6.1 and older kernels. This patch add a check in a wrong function in the
> same file.
> 
> Signed-off-by: Zhang Zekun <zhangzekun11@xxxxxxxxxx>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> index 4776196b2021..98bd8a23e5b0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c
> @@ -394,7 +394,7 @@ static ssize_t amdgpu_debugfs_regs_smc_read(struct file *f, char __user *buf,
>  	if (!adev->smc_rreg)
>  		return -EOPNOTSUPP;
>  
> -	if (size > 4096 || size & 0x3 || *pos & 0x3)
> +	if (size & 0x3 || *pos & 0x3)
>  		return -EINVAL;
>  
>  	while (size) {
> -- 
> 2.17.1
> 
> 

Sorry, but 4.19.y is now end-of-life.




[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux