diff options
| author | Srinivasan Shanmugam <[email protected]> | 2023-07-26 14:42:11 +0000 |
|---|---|---|
| committer | Alex Deucher <[email protected]> | 2023-07-27 18:59:30 +0000 |
| commit | 9eec1fc150094857887f44ead59a2c896fbff6d3 (patch) | |
| tree | c5f75383f5d0366586929eced172e0bb08adeee3 /drivers/gpu/drm/amd/amdgpu/amdgpu_trace_points.c | |
| parent | drm/amdgpu: Fix unnecessary else after return in 'amdgpu_eeprom_xfer' (diff) | |
| download | kernel-9eec1fc150094857887f44ead59a2c896fbff6d3.tar.gz kernel-9eec1fc150094857887f44ead59a2c896fbff6d3.zip | |
drm/radeon: Prefer strscpy over strlcpy in 'radeon_combios_get_power_modes'
strlcpy() reads the entire source buffer first. This read may exceed the
destination size limit. This is both inefficient and can lead to linear
read overflows if a source string is not NUL-terminated. The safe
replacement is strscpy() [1].
cleanup to remove the strlcpy() function entirely from the kernel [2].
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html#strlcpy
[2] https://github.com/KSPP/linux/issues/89
Fixes the following:
WARNING: Prefer strscpy over strlcpy
+ strlcpy(info.type, name, sizeof(info.type));
WARNING: Prefer strscpy over strlcpy
+ strlcpy(info.type, name, sizeof(info.type));
Cc: Guchun Chen <[email protected]>
Cc: Christian König <[email protected]>
Cc: Alex Deucher <[email protected]>
Signed-off-by: Srinivasan Shanmugam <[email protected]>
Reviewed-by: Alex Deucher <[email protected]>
Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_trace_points.c')
0 files changed, 0 insertions, 0 deletions
