public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 4.19] Revert "drm/amdgpu: add missing size check in amdgpu_debugfs_gprwave_read()"
@ 2024-12-04  8:22 Zhang Zekun
  2024-12-04 15:41 ` Sasha Levin
  2024-12-06  9:29 ` Greg KH
  0 siblings, 2 replies; 4+ messages in thread
From: Zhang Zekun @ 2024-12-04  8:22 UTC (permalink / raw)
  To: gregkh; +Cc: cve, stable, kevinyang.wang, alexander.deucher, liuyongqiang13

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@huawei.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 4.19] Revert "drm/amdgpu: add missing size check in amdgpu_debugfs_gprwave_read()"
  2024-12-04  8:22 [PATCH 4.19] Revert "drm/amdgpu: add missing size check in amdgpu_debugfs_gprwave_read()" Zhang Zekun
@ 2024-12-04 15:41 ` Sasha Levin
  2024-12-04 22:11   ` Sasha Levin
  2024-12-06  9:29 ` Greg KH
  1 sibling, 1 reply; 4+ messages in thread
From: Sasha Levin @ 2024-12-04 15:41 UTC (permalink / raw)
  To: stable; +Cc: Zhang Zekun, Sasha Levin

[ Sasha's backport helper bot ]

Hi,

No upstream commit was identified. Using temporary commit for testing.

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-4.19.y       |  Success    |  Success   |

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 4.19] Revert "drm/amdgpu: add missing size check in amdgpu_debugfs_gprwave_read()"
  2024-12-04 15:41 ` Sasha Levin
@ 2024-12-04 22:11   ` Sasha Levin
  0 siblings, 0 replies; 4+ messages in thread
From: Sasha Levin @ 2024-12-04 22:11 UTC (permalink / raw)
  To: stable; +Cc: Zhang Zekun, Sasha Levin

[ Sasha's backport helper bot ]

Hi,

No upstream commit was identified. Using temporary commit for testing.

Results of testing on various branches:

| Branch                    | Patch Apply | Build Test |
|---------------------------|-------------|------------|
| stable/linux-4.19.y       |  Success    |  Success   |

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 4.19] Revert "drm/amdgpu: add missing size check in amdgpu_debugfs_gprwave_read()"
  2024-12-04  8:22 [PATCH 4.19] Revert "drm/amdgpu: add missing size check in amdgpu_debugfs_gprwave_read()" Zhang Zekun
  2024-12-04 15:41 ` Sasha Levin
@ 2024-12-06  9:29 ` Greg KH
  1 sibling, 0 replies; 4+ messages in thread
From: Greg KH @ 2024-12-06  9:29 UTC (permalink / raw)
  To: Zhang Zekun
  Cc: cve, stable, kevinyang.wang, alexander.deucher, liuyongqiang13

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@huawei.com>
> ---
>  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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-12-06  9:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-04  8:22 [PATCH 4.19] Revert "drm/amdgpu: add missing size check in amdgpu_debugfs_gprwave_read()" Zhang Zekun
2024-12-04 15:41 ` Sasha Levin
2024-12-04 22:11   ` Sasha Levin
2024-12-06  9:29 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox