Revert "drm/amdgpu: add missing size check in amdgpu_debugfs_gprwave_read()"

This reverts commit 25d7e84343.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
Zhang Zekun
2024-12-04 16:27:52 +08:00
committed by Greg Kroah-Hartman
parent 4ed23e9dd8
commit 6ec0b877d1

View File

@@ -419,7 +419,7 @@ static ssize_t amdgpu_debugfs_regs_pcie_write(struct file *f, const char __user
ssize_t result = 0; ssize_t result = 0;
int r; int r;
if (size > 4096 || size & 0x3 || *pos & 0x3) if (size & 0x3 || *pos & 0x3)
return -EINVAL; return -EINVAL;
r = pm_runtime_get_sync(adev_to_drm(adev)->dev); r = pm_runtime_get_sync(adev_to_drm(adev)->dev);