* Re: [PATCH] drm/amd/display: fix array-bounds error in dc_stream_remove_writeback()
[not found] ` <20221006064615.GA2817657@roeck-us.net>
@ 2022-10-06 17:23 ` Guenter Roeck
2022-10-11 9:49 ` Thorsten Leemhuis
0 siblings, 1 reply; 2+ messages in thread
From: Guenter Roeck @ 2022-10-06 17:23 UTC (permalink / raw
To: Hamza Mahfooz
Cc: linux-kernel, Harry Wentland, Leo Li, Rodrigo Siqueira,
Alex Deucher, Christian König, Pan, Xinhui, David Airlie,
Daniel Vetter, Lee, Alvin, Alex Hung, Pavle Kotarac, Stylon Wang,
Aurabindo Pillai, Leo (Hanghong) Ma, Hersen Wu, Paul Hsieh,
Jimmy Kizito, amd-gfx, dri-devel, regressions
On Wed, Oct 05, 2022 at 11:46:15PM -0700, Guenter Roeck wrote:
> On Tue, Sep 27, 2022 at 03:12:00PM -0400, Hamza Mahfooz wrote:
> > Address the following error:
> > drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c: In function ‘dc_stream_remove_writeback’:
> > drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:527:55: error: array subscript [0, 0] is outside array bounds of ‘struct dc_writeback_info[1]’ [-Werror=array-bounds]
> > 527 | stream->writeback_info[j] = stream->writeback_info[i];
> > | ~~~~~~~~~~~~~~~~~~~~~~^~~
> > In file included from ./drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:1269,
> > from ./drivers/gpu/drm/amd/amdgpu/../display/dc/inc/core_types.h:29,
> > from ./drivers/gpu/drm/amd/amdgpu/../display/dc/basics/dc_common.h:29,
> > from drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:27:
> > ./drivers/gpu/drm/amd/amdgpu/../display/dc/dc_stream.h:241:34: note: while referencing ‘writeback_info’
> > 241 | struct dc_writeback_info writeback_info[MAX_DWB_PIPES];
> > |
> >
> > Currently, we aren't checking to see if j remains within
> > writeback_info[]'s bounds. So, add a check to make sure that we aren't
> > overflowing the buffer.
> >
> > Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
>
> With gcc 11.3, this patch doesn't fix a problem, it introduces one.
>
> Building csky:allmodconfig ... failed
> --------------
> Error log:
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c: In function 'dc_stream_remove_writeback':
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:527:83: error: array subscript 1 is above array bounds of 'struct dc_writeback_info[1]' [-Werror=array-bounds]
> 527 | stream->writeback_info[j] = stream->writeback_info[i];
>
> Building mips:allmodconfig ... failed
> --------------
> Error log:
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c: In function 'dc_stream_remove_writeback':
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:527:83: error: array subscript [0, 0] is outside array bounds of 'struct dc_writeback_info[1]' [-Werror=array-bounds]
> 527 | stream->writeback_info[j] = stream->writeback_info[i];
>
> Building arm:allmodconfig ... failed
> --------------
> Error log:
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c: In function 'dc_stream_remove_writeback':
> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:527:83: error: array subscript [0, 0] is outside array bounds of 'struct dc_writeback_info[1]' [-Werror=array-bounds]
> 527 | stream->writeback_info[j] = stream->writeback_info[i];
>
#regzbot introduced: 5d8c3e836fc2
Complete list of build failures in my test system due to this patch,
observed when building with gcc 11.3:
Build results:
total: 149 pass: 131 fail: 18
Failed builds:
alpha:allmodconfig
arm:allmodconfig
arm64:allmodconfig
csky:allmodconfig
i386:allyesconfig
i386:allmodconfig
mips:allmodconfig
openrisc:allmodconfig
parisc:allmodconfig
powerpc:allmodconfig
powerpc:ppc32_allmodconfig
riscv32:allmodconfig
riscv:allmodconfig
s390:allmodconfig
sparc64:allmodconfig
x86_64:allyesconfig
x86_64:allmodconfig
xtensa:allmodconfig
Guenter
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] drm/amd/display: fix array-bounds error in dc_stream_remove_writeback()
2022-10-06 17:23 ` [PATCH] drm/amd/display: fix array-bounds error in dc_stream_remove_writeback() Guenter Roeck
@ 2022-10-11 9:49 ` Thorsten Leemhuis
0 siblings, 0 replies; 2+ messages in thread
From: Thorsten Leemhuis @ 2022-10-11 9:49 UTC (permalink / raw
To: Guenter Roeck; +Cc: linux-kernel, amd-gfx, dri-devel, regressions
[removed a lot of people from the list of recipients, as this is mainly
for Guenter]
Hi Guenter!
On 06.10.22 19:23, Guenter Roeck wrote:
> On Wed, Oct 05, 2022 at 11:46:15PM -0700, Guenter Roeck wrote:
>> On Tue, Sep 27, 2022 at 03:12:00PM -0400, Hamza Mahfooz wrote:
>>> Address the following error:
>>> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c: In function ‘dc_stream_remove_writeback’:
>>> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:527:55: error: array subscript [0, 0] is outside array bounds of ‘struct dc_writeback_info[1]’ [-Werror=array-bounds]
>>> 527 | stream->writeback_info[j] = stream->writeback_info[i];
>>> | ~~~~~~~~~~~~~~~~~~~~~~^~~
>>> In file included from ./drivers/gpu/drm/amd/amdgpu/../display/dc/dc.h:1269,
>>> from ./drivers/gpu/drm/amd/amdgpu/../display/dc/inc/core_types.h:29,
>>> from ./drivers/gpu/drm/amd/amdgpu/../display/dc/basics/dc_common.h:29,
>>> from drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:27:
>>> ./drivers/gpu/drm/amd/amdgpu/../display/dc/dc_stream.h:241:34: note: while referencing ‘writeback_info’
>>> 241 | struct dc_writeback_info writeback_info[MAX_DWB_PIPES];
>>> |
>>>
>>> Currently, we aren't checking to see if j remains within
>>> writeback_info[]'s bounds. So, add a check to make sure that we aren't
>>> overflowing the buffer.
>>>
>>> Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com>
>>
>> With gcc 11.3, this patch doesn't fix a problem, it introduces one.
>>
>> Building csky:allmodconfig ... failed
>> --------------
>> Error log:
>> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c: In function 'dc_stream_remove_writeback':
>> drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_stream.c:527:83: error: array subscript 1 is above array bounds of 'struct dc_writeback_info[1]' [-Werror=array-bounds]
>> 527 | stream->writeback_info[j] = stream->writeback_info[i];
>
> [...]
>
> #regzbot introduced: 5d8c3e836fc2
Thx for using regzbot, much appreciated. JFYI, the initial report was
your own mail you were replying to here, so a "#regzbot ^introduced:
..." would have been more appropriate. In this case it didn't matter
anyway, as the fix didn't include a "Link:" tag to the initial report
anyway. No worries, I just have to tell regzbot about the fix manually then:
#regzbot fixed-by: faf4d8e07f5b67
Ciao, Thorsten
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-10-11 9:49 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20220927191200.216488-1-hamza.mahfooz@amd.com>
[not found] ` <20221006064615.GA2817657@roeck-us.net>
2022-10-06 17:23 ` [PATCH] drm/amd/display: fix array-bounds error in dc_stream_remove_writeback() Guenter Roeck
2022-10-11 9:49 ` Thorsten Leemhuis
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).