drm/amdgpu: don't clamp debugfs register access to the BAR size
authorAlex Deucher <alexander.deucher@amd.com>
Mon, 11 Feb 2019 21:49:47 +0000 (16:49 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 13 Feb 2019 22:51:41 +0000 (17:51 -0500)
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.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c

index dd9a4fb9ce39b03e781f4581d4675b2a5aafbd67..4ae3ff9a1d4c9ac923d6689687c4ed5def0cb8f5 100644 (file)
@@ -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);