linux/drivers/gpu/drm/amd/display/amdgpu_dm
Nicholas Kazlauskas 090afc1e40 drm/amd/display: Fix overflow/truncation from strncpy.
[Why]

New GCC warnings for stringop-truncation and stringop-overflow help
catch common misuse of strncpy. This patch suppresses these warnings
by fixing bugs identified by them.

[How]

Since the parameter passed for name in amdpgu_dm_create_common_mode has
no fixed length, if the string is >= DRM_DISPLAY_MODE_LEN then
mode->name will not be null-terminated.

The truncation in fill_audio_info won't actually occur (and the string
will be null-terminated since the buffer is initialized to zero), but
the warning can be suppressed by using the proper buffer size.

This patch fixes both issues by using the real size for the buffer and
making use of strscpy (which always terminates).

Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
2018-12-04 15:01:56 -05:00
..
amdgpu_dm_color.c drm/amd/display: Use DGAM ROM or RAM 2018-08-27 11:09:58 -05:00
amdgpu_dm_crc.c Merge drm/drm-next into drm-misc-next 2018-08-27 10:00:03 -04:00
amdgpu_dm_debugfs.c drm/amdgpu/display: dm/amdgpu: make dp phy debugfs for eDP 2018-10-12 12:53:04 -05:00
amdgpu_dm_debugfs.h drm/amd/display: Add support for hw_state logging via debugfs 2018-08-27 15:20:17 -05:00
amdgpu_dm_helpers.c drm/amd/display: Support reading hw state from debugfs file 2018-08-27 15:20:49 -05:00
amdgpu_dm_irq.c drm/amd/display: Flatten irq handler data struct 2018-10-09 17:03:38 -05:00
amdgpu_dm_irq.h
amdgpu_dm_mst_types.c drm/amd/dm: Understand why attaching path/tile properties are needed 2018-11-21 15:52:32 -05:00
amdgpu_dm_mst_types.h drm/amd/display: Cleanup MST non-atomic code workaround 2018-11-07 18:20:49 -05:00
amdgpu_dm_pp_smu.c drm/amd/display: Fix Null point error if smu ip was disabled 2018-10-24 20:03:43 -05:00
amdgpu_dm_services.c BackMerge v4.18-rc7 into drm-next 2018-07-30 10:39:22 +10:00
amdgpu_dm.c drm/amd/display: Fix overflow/truncation from strncpy. 2018-12-04 15:01:56 -05:00
amdgpu_dm.h drm/amd/display: Support amdgpu "max bpc" connector property (v2) 2018-11-15 17:48:31 -05:00
Makefile drm/amd/display: Moving powerplay functions to a separate class 2018-07-05 16:38:41 -05:00