[igt-dev] [PATCH i-g-t v2] lib/igt_kms: Fix memory corruption

Daniel Stone daniels at collabora.com
Tue Nov 7 11:24:04 UTC 2023


On 07/11/2023 08:58, Vignesh Raman wrote:
> On 06/11/23 20:13, Daniel Stone wrote:
>> What I mean is to make sure that the code cannot access out of 
>> bounds, regardless of the number. We can set IGT_MAX_PIPES to 32 but 
>> then someone will hit the same failure when there are more CRTCs than 
>> that.
>>
>> The way to do this would probably be to igt_require() that 
>> count_crtcs does not exceed IGT_MAX_PIPES, in all the paths where we 
>> access the crtcs array. There is no need to bump the limit to 32 
>> until it's required.
>
> Okay understood. We can use igt_assert_f to make the test fail 
> (instead of skipping it) if count_crtcs exceeds IGT_MAX_PIPES.
>
> ERROR - Igt error: (kms_vblank:81) igt_kms-CRITICAL: Failed assertion: 
> resources->count_crtcs <= IGT_MAX_PIPES
> ERROR - Igt error: (kms_vblank:81) igt_kms-CRITICAL: count_crtcs 
> exceeds IGT_MAX_PIPES, count_crtcs=16, IGT_MAX_PIPES=8
> ERROR - Igt error: Test kms_vblank failed.
>
> I will check other code paths as well. Thanks.

That's perfect, thanks Vignesh.

Cheers,

Daniel




More information about the igt-dev mailing list