drm/amdgpu: Adjust debugfs register access permissions
Subsystems (2)
Alex Deucher
maintainerPATCH 1/3 drm/amdgpu: Adjust debugfs register access permissions
Regular users shouldn't have read access.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +1 -1
@@ -1654,7 +1654,7 @@ int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)for (i =0 ; i <ARRAY_SIZE (debugfs_regs); i++) { ent =debugfs_create_file (debugfs_regs_names[i], -S_IFREG |0444 , root, +S_IFREG |0400 , root, adev, debugfs_regs[i]);if (!i && !IS_ERR_OR_NULL (ent))i_size_write (ent->d_inode, adev->rmmio_size);
Signature · 1 line
2.46.2
Alex Deucher
maintainerPATCH 2/3 drm/amdgpu: Adjust debugfs eviction and IB access permissions
Users should not be able to run these.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +3 -3
@@ -2108,11 +2108,11 @@ int amdgpu_debugfs_init(struct amdgpu_device *adev)amdgpu_securedisplay_debugfs_init (adev);amdgpu_fw_attestation_debugfs_init (adev); -debugfs_create_file ("amdgpu_evict_vram" ,0444 , root, adev, +debugfs_create_file ("amdgpu_evict_vram" ,0400 , root, adev, &amdgpu_evict_vram_fops); -debugfs_create_file ("amdgpu_evict_gtt" ,0444 , root, adev, +debugfs_create_file ("amdgpu_evict_gtt" ,0400 , root, adev, &amdgpu_evict_gtt_fops); -debugfs_create_file ("amdgpu_test_ib" ,0444 , root, adev, +debugfs_create_file ("amdgpu_test_ib" ,0400 , root, adev, &amdgpu_debugfs_test_ib_fops);debugfs_create_file ("amdgpu_vm_info" ,0444 , root, adev, &amdgpu_debugfs_vm_info_fops);
Signature · 1 line
2.46.2
Alex Deucher
maintainerPATCH 3/3 drm/amdgpu: add missing size check in amdgpu_debugfs_gprwave_read()
In reply to Alex DeucherAvoid a possible buffer overflow if size is larger than 4K.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +1 -1
@@ -402,7 +402,7 @@ static ssize_t amdgpu_debugfs_gprwave_read(struct file *f, char __user *buf, sizint 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);
Signature · 1 line
2.46.2
Ping on this series?
Alex
Quoted 24 lines · Alex Deucher
Regular users shouldn't have read access.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +1
-2@@ -1654,7 +1654,7 @@ int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)for (i =0 ; i <ARRAY_SIZE (debugfs_regs); i++) { ent =debugfs_create_file (debugfs_regs_names[i], -S_IFREG |0444 , root, +S_IFREG |0400 , root, adev, debugfs_regs[i]);if (!i && !IS_ERR_OR_NULL (ent))i_size_write (ent->d_inode, adev->rmmio_size); --2.46.2
Ping on this series?
Alex
Quoted 30 lines · Alex Deucher
Ping on this series?
Alex
Quoted 24 lines · Alex Deucher
Regular users shouldn't have read access.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +1
-2@@ -1654,7 +1654,7 @@ int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)for (i =0 ; i <ARRAY_SIZE (debugfs_regs); i++) { ent =debugfs_create_file (debugfs_regs_names[i], -S_IFREG |0444 , root, +S_IFREG |0400 , root, adev, debugfs_regs[i]);if (!i && !IS_ERR_OR_NULL (ent))i_size_write (ent->d_inode, adev->rmmio_size); --2.46.2
Wang, Yang(Kevin)
Reviewed-by[AMD Official Use Only - AMD Internal Distribution Only]
Best Regards,
Kevin
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, October 31, 2024 12:03 AM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 1/3] drm/amdgpu: Adjust debugfs register access permissions
Ping on this series?
Alex
Quoted 30 lines · Alex Deucher
Ping on this series?
Alex
Quoted 24 lines · Alex Deucher
Regular users shouldn't have read access.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +1
-2@@ -1654,7 +1654,7 @@ int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)for (i =0 ; i <ARRAY_SIZE (debugfs_regs); i++) { ent =debugfs_create_file (debugfs_regs_names[i], -S_IFREG |0444 , root, +S_IFREG |0400 , root, adev, debugfs_regs[i]);if (!i && !IS_ERR_OR_NULL (ent))i_size_write (ent->d_inode, adev->rmmio_size); --2.46.2
Quoted 4 lines · Yang(Kevin)
[AMD Official Use Only - AMD Internal Distribution Only]
Reviewed-by Yang Wang <[email protected]>
Is this for the whole series or just the first patch?
Thanks,
Alex
Quoted 46 lines
Best Regards,
Kevin-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, October 31, 2024 12:03 AM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 1/3] drm/amdgpu: Adjust debugfs register access permissionsPing on this series?
Alex
Quoted 30 lines · Alex Deucher
Ping on this series?
Alex
Quoted 24 lines · Alex Deucher
Regular users shouldn't have read access.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +1
-2@@ -1654,7 +1654,7 @@ int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)for (i =0 ; i <ARRAY_SIZE (debugfs_regs); i++) { ent =debugfs_create_file (debugfs_regs_names[i], -S_IFREG |0444 , root, +S_IFREG |0400 , root, adev, debugfs_regs[i]);if (!i && !IS_ERR_OR_NULL (ent))i_size_write (ent->d_inode, adev->rmmio_size); --2.46.2
Wang, Yang(Kevin)
Reviewed-by[AMD Official Use Only - AMD Internal Distribution Only]
-----Original Message-----
From: Alex Deucher <[email protected]>
Sent: Thursday, October 31, 2024 10:59 AM
To: Wang, Yang(Kevin) <[email protected]>
Cc: Deucher, Alexander <[email protected]>; [email protected]
Subject: Re: [PATCH 1/3] drm/amdgpu: Adjust debugfs register access permissions
Quoted 4 lines · Yang(Kevin)
[AMD Official Use Only - AMD Internal Distribution Only]
Reviewed-by Yang Wang <[email protected]>
Is this for the whole series or just the first patch?
Thanks,
Alex
[Kevin]:
the whole patch set is looks good to me.
Series is
Best Regards,
Kevin
Quoted 51 lines
Best Regards,
Kevin-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Alex Deucher
Sent: Thursday, October 31, 2024 12:03 AM
To: Deucher, Alexander <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH 1/3] drm/amdgpu: Adjust debugfs register access permissionsPing on this series?
Alex
Quoted 33 lines · Alex Deucher
Ping on this series?
Alex
Quoted 27 lines · Alex Deucher
Regular users shouldn't have read access.
Signed-off-by Alex Deucher <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +1
-1@@ -1654,7 +1654,7 @@ int amdgpu_debugfs_regs_init(struct amdgpu_device *adev)for (i =0 ; i <ARRAY_SIZE (debugfs_regs); i++) { ent =debugfs_create_file (debugfs_regs_names[i], -S_IFREG |0444 , root, +S_IFREG |0400 , root, adev, debugfs_regs[i]);if (!i && !IS_ERR_OR_NULL (ent))i_size_write(ent->d_inode,
adev->rmmio_size);
--
2.46.2