mbox series

[Outreachy,kernel,0/5] drm/amdgpu: Replace snprintf() with sysfs_emit

Message ID cover.1603371258.git.sylphrenadin@gmail.com
Headers show
Series drm/amdgpu: Replace snprintf() with sysfs_emit | expand

Message

Sumera Priyadarsini Oct. 22, 2020, 1:37 p.m. UTC
Using snprintf() for show() methods holds the risk of buffer overrun
as snprintf() does not know the PAGE_SIZE maximum of the temporary
buffer used to output sysfs content.

This patchset is a series of Coccinelle cleanups across the staging
directory to convert snprintf with scnprintf in the relevant files.

Sumera Priyadarsini (5):
  gpu: drm: amdgpu: Replace snprintf() with sysfs_emit()
  gpu: drm: amdgpu: Replace snprintf() with sysfs_emit()
  gpu: drm: amdgpu: Replace snprintf() with sysfs_emit()
  gpu: drm: amdgpu: Replace snprintf() with sysfs_emit()
  gpu: drm: amdgpu: Replace snprintf() with sysfs_emit()

 drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c   | 8 ++++----
 drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c  | 4 ++--
 drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c      | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c      | 4 ++--
 5 files changed, 10 insertions(+), 10 deletions(-)

Comments

Daniel Vetter Oct. 22, 2020, 2:13 p.m. UTC | #1
On Thu, Oct 22, 2020 at 07:07:50PM +0530, Sumera Priyadarsini wrote:
> Using snprintf() for show() methods holds the risk of buffer overrun

> as snprintf() does not know the PAGE_SIZE maximum of the temporary

> buffer used to output sysfs content.

> 

> This patchset is a series of Coccinelle cleanups across the staging

> directory to convert snprintf with scnprintf in the relevant files.


I think you need to edit your template here since this is now drivers/gpu,
not staging :-)
-Daniel

> 

> Sumera Priyadarsini (5):

>   gpu: drm: amdgpu: Replace snprintf() with sysfs_emit()

>   gpu: drm: amdgpu: Replace snprintf() with sysfs_emit()

>   gpu: drm: amdgpu: Replace snprintf() with sysfs_emit()

>   gpu: drm: amdgpu: Replace snprintf() with sysfs_emit()

>   gpu: drm: amdgpu: Replace snprintf() with sysfs_emit()

> 

>  drivers/gpu/drm/amd/amdgpu/amdgpu_atombios.c | 2 +-

>  drivers/gpu/drm/amd/amdgpu/amdgpu_device.c   | 8 ++++----

>  drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c  | 4 ++--

>  drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c      | 2 +-

>  drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c      | 4 ++--

>  5 files changed, 10 insertions(+), 10 deletions(-)

> 

> -- 

> 2.25.1

> 


-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch