Re: mainline build failure due to 5d8c3e836fc2 ("drm/amd/display: fix array-bounds error in dc_stream_remove_writeback()")

2022-10-07 Thread Linus Torvalds
On Thu, Oct 6, 2022 at 1:50 PM Sudip Mukherjee wrote: > > > And it looks like Sudip's proposed fix for this particular code is > > additionally fixing unsigned vs signed as well. I think -Warray-bounds > > did its job (though, with quite a confusing index range in the report). > > Not my.

Re: mainline build failure due to 5d8c3e836fc2 ("drm/amd/display: fix array-bounds error in dc_stream_remove_writeback()")

2022-10-06 Thread Sudip Mukherjee
On Thu, Oct 6, 2022 at 9:37 PM Kees Cook wrote: > > On Thu, Oct 06, 2022 at 12:39:40PM -0700, Linus Torvalds wrote: > > What confuses me is that error message ("array subscript [0, 0] is > > outside array bounds of 'struct dc_writeback_info[1]') which seems to > > be aware that the value is

Re: mainline build failure due to 5d8c3e836fc2 ("drm/amd/display: fix array-bounds error in dc_stream_remove_writeback()")

2022-10-06 Thread Kees Cook
On Thu, Oct 06, 2022 at 12:39:40PM -0700, Linus Torvalds wrote: > What confuses me is that error message ("array subscript [0, 0] is > outside array bounds of 'struct dc_writeback_info[1]') which seems to > be aware that the value is actually 0. I've seen bugs in the tracker where the reporting

Re: mainline build failure due to 5d8c3e836fc2 ("drm/amd/display: fix array-bounds error in dc_stream_remove_writeback()")

2022-10-06 Thread Sudip Mukherjee
On Thu, Oct 6, 2022 at 8:39 PM Linus Torvalds wrote: > > On Thu, Oct 6, 2022 at 1:51 AM Sudip Mukherjee (Codethink) > wrote: > > > > This is only seen with gcc-11, gcc-12 builds are ok. > > Hmm. This seems to be some odd gcc issue. > > > The fix *MAY* be to just add a '&& i < MAX_DWB_PIPES'

Re: mainline build failure due to 5d8c3e836fc2 ("drm/amd/display: fix array-bounds error in dc_stream_remove_writeback()")

2022-10-06 Thread Hamza Mahfooz
Hey Linus, On 2022-10-06 15:39, Linus Torvalds wrote: On Thu, Oct 6, 2022 at 1:51 AM Sudip Mukherjee (Codethink) wrote: This is only seen with gcc-11, gcc-12 builds are ok. Hmm. This seems to be some odd gcc issue. I *think* that what is going on is that the test j = 0 ; j <

Re: mainline build failure due to 5d8c3e836fc2 ("drm/amd/display: fix array-bounds error in dc_stream_remove_writeback()")

2022-10-06 Thread Linus Torvalds
On Thu, Oct 6, 2022 at 1:51 AM Sudip Mukherjee (Codethink) wrote: > > This is only seen with gcc-11, gcc-12 builds are ok. Hmm. This seems to be some odd gcc issue. I *think* that what is going on is that the test j = 0 ; j < MAX_DWB_PIPES makes gcc decide that "hey, j is in the range

mainline build failure due to 5d8c3e836fc2 ("drm/amd/display: fix array-bounds error in dc_stream_remove_writeback()")

2022-10-06 Thread Sudip Mukherjee (Codethink)
Hi All, The latest mainline kernel branch fails to build allmodconfig for every ARCH with gcc-11 with the 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:83: error: array