Skip to contentSkip to conversation

drm/amdgpu: don't clamp debugfs register access to the BAR size

PATCH In review Alex Deucher via amd-gfx 1 participant 2 messages Feb 11, 2019 – Feb 12, 2019 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu: don't clamp debugfs register access to the BAR size

This prevents us from accessing extended registers in tools like umr. The register access functions already check if the offset is beyond the BAR size and use the indirect accessors with locking so this is safe.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 ---
 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -3
index dd9a4fb9ce39..4ae3ff9a1d4c 100644
@@ -158,9 +158,6 @@ static int  amdgpu_debugfs_process_reg_op(bool read, struct file *f,
 	while (size) {
 		uint32_t value;
 
-		if (*pos > adev->rmmio_size)
-			goto end;
-
 		if (read) {
 			value = RREG32(*pos >> 2);
 			r = put_user(value, (uint32_t *)buf);
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20190211215221.31597-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org

author Reviewed-by Christian König
#2 lore raw

Am 11.02.19 um 22:52 schrieb Alex Deucher via amd-gfx:

Quoted 6 lines

This prevents us from accessing extended registers in tools like umr. The register access functions already check if the offset is beyond the BAR size and use the indirect accessors with locking so this is safe.

Quoted 9 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 3 ---
  1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -0
index dd9a4fb9ce39..4ae3ff9a1d4c 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c static int amdgpu_debugfs_process_reg_op(bool read, struct file *f, · line 163

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +0 -3
@@ -158,9 +158,6 @@ static int  amdgpu_debugfs_process_reg_op(bool read, struct file *f,
  	while (size) {
  		uint32_t value;
 
-		if (*pos > adev->rmmio_size)
-			goto end;
-
  		if (read) {
  			value = RREG32(*pos >> 2);
  			r = put_user(value, (uint32_t *)buf);

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx