Revision 58fca355ad37dcb5f785d9095db5f748b79c5dc2 authored by Srinivasan Shanmugam on 07 February 2024, 04:50:57 UTC, committed by Alex Deucher on 07 February 2024, 23:30:04 UTC
'stream_enc_regs' array is an array of dcn10_stream_enc_registers
structures. The array is initialized with four elements, corresponding
to the four calls to stream_enc_regs() in the array initializer. This
means that valid indices for this array are 0, 1, 2, and 3.

The error message 'stream_enc_regs' 4 <= 5 below, is indicating that
there is an attempt to access this array with an index of 5, which is
out of bounds. This could lead to undefined behavior

Here, eng_id is used as an index to access the stream_enc_regs array. If
eng_id is 5, this would result in an out-of-bounds access on the
stream_enc_regs array.

Thus fixing Buffer overflow error in dcn301_stream_encoder_create
reported by Smatch:
drivers/gpu/drm/amd/amdgpu/../display/dc/resource/dcn301/dcn301_resource.c:1011 dcn301_stream_encoder_create() error: buffer overflow 'stream_enc_regs' 4 <= 5

Fixes: 3a83e4e64bb1 ("drm/amd/display: Add dcn3.01 support to DC (v2)")
Cc: Roman Li <Roman.Li@amd.com>
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Cc: Aurabindo Pillai <aurabindo.pillai@amd.com>
Signed-off-by: Srinivasan Shanmugam <srinivasan.shanmugam@amd.com>
Reviewed-by: Roman Li <roman.li@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent e63e35f
History
File Mode Size
Makefile -rw-r--r-- 1016 bytes
fabs.c -rw-r--r-- 312 bytes
fadd.c -rw-r--r-- 739 bytes
fadds.c -rw-r--r-- 770 bytes
fcmpo.c -rw-r--r-- 1010 bytes
fcmpu.c -rw-r--r-- 916 bytes
fctiw.c -rw-r--r-- 463 bytes
fctiwz.c -rw-r--r-- 573 bytes
fdiv.c -rw-r--r-- 1.2 KB
fdivs.c -rw-r--r-- 1.2 KB
fmadd.c -rw-r--r-- 1.1 KB
fmadds.c -rw-r--r-- 1.1 KB
fmr.c -rw-r--r-- 298 bytes
fmsub.c -rw-r--r-- 1.1 KB
fmsubs.c -rw-r--r-- 1.2 KB
fmul.c -rw-r--r-- 1021 bytes
fmuls.c -rw-r--r-- 1.0 KB
fnabs.c -rw-r--r-- 313 bytes
fneg.c -rw-r--r-- 312 bytes
fnmadd.c -rw-r--r-- 1.1 KB
fnmadds.c -rw-r--r-- 1.2 KB
fnmsub.c -rw-r--r-- 1.2 KB
fnmsubs.c -rw-r--r-- 1.2 KB
fre.c -rw-r--r-- 229 bytes
fres.c -rw-r--r-- 230 bytes
frsp.c -rw-r--r-- 528 bytes
frsqrte.c -rw-r--r-- 227 bytes
frsqrtes.c -rw-r--r-- 228 bytes
fsel.c -rw-r--r-- 786 bytes
fsqrt.c -rw-r--r-- 746 bytes
fsqrts.c -rw-r--r-- 777 bytes
fsub.c -rw-r--r-- 869 bytes
fsubs.c -rw-r--r-- 900 bytes
lfd.c -rw-r--r-- 384 bytes
lfs.c -rw-r--r-- 830 bytes
math.c -rw-r--r-- 11.2 KB
math_efp.c -rw-r--r-- 20.3 KB
mcrfs.c -rw-r--r-- 620 bytes
mffs.c -rw-r--r-- 320 bytes
mtfsb0.c -rw-r--r-- 359 bytes
mtfsb1.c -rw-r--r-- 358 bytes
mtfsf.c -rw-r--r-- 1.1 KB
mtfsfi.c -rw-r--r-- 463 bytes
stfd.c -rw-r--r-- 339 bytes
stfiwx.c -rw-r--r-- 291 bytes
stfs.c -rw-r--r-- 822 bytes
udivmodti4.c -rw-r--r-- 3.4 KB

back to top