提交 c71dbd93 编写于 作者: T Tom St Denis 提交者: Alex Deucher

drm/amd/amdgpu: ring debugfs is read in increments of 4 bytes

If a user tries to read a non-multiple of 4 bytes it would have
read until the end of the ring potentially crashing the user
task.
Signed-off-by: NTom St Denis <tom.stdenis@amd.com>
Reviewed-by: NChristian König <christian.koenig@amd.com>
Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
上级 4f4824b5
...@@ -383,7 +383,7 @@ static ssize_t amdgpu_debugfs_ring_read(struct file *f, char __user *buf, ...@@ -383,7 +383,7 @@ static ssize_t amdgpu_debugfs_ring_read(struct file *f, char __user *buf,
int r, i; int r, i;
uint32_t value, result, early[3]; uint32_t value, result, early[3];
if (*pos & 3) if (*pos & 3 || size & 3)
return -EINVAL; return -EINVAL;
result = 0; result = 0;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册