diff options
| author | Alex Deucher <[email protected]> | 2024-10-23 20:52:08 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2024-11-05 15:35:59 +0000 |
| commit | f5d873f5825b40d886d03bd2aede91d4cf002434 (patch) | |
| tree | 310746d73528deefebf72a59dc83effbc438cea2 /drivers/gpu/drm/amd | |
| parent | drm/amdgpu: Adjust debugfs eviction and IB access permissions (diff) | |
| download | kernel-f5d873f5825b40d886d03bd2aede91d4cf002434.tar.gz kernel-f5d873f5825b40d886d03bd2aede91d4cf002434.zip | |
drm/amdgpu: add missing size check in amdgpu_debugfs_gprwave_read()
Avoid a possible buffer overflow if size is larger than 4K.
Reviewed-by: Yang Wang <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index 0cb3ba448c6c..a68338cb7b4a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -402,7 +402,7 @@ static ssize_t amdgpu_debugfs_gprwave_read(struct file *f, char __user *buf, siz int r; uint32_t *data, x; - if (size & 0x3 || *pos & 0x3) + if (size > 4096 || size & 0x3 || *pos & 0x3) return -EINVAL; r = pm_runtime_get_sync(adev_to_drm(adev)->dev); |
