Re: [PATCH] drm/radeon: fix potential buffer overflow in ni_set_mc_special_registers()

2022-06-06 Thread Alex Deucher
Applied. Thanks! Alex On Mon, Jun 6, 2022 at 9:51 AM Alexey Kodanev wrote: > > The last case label can write two buffers 'mc_reg_address[j]' and > 'mc_data[j]' with 'j' offset equal to SMC_NISLANDS_MC_REGISTER_ARRAY_SIZE > since there are no checks for this value in both case labels after the >

[PATCH] drm/radeon: fix potential buffer overflow in ni_set_mc_special_registers()

2022-06-06 Thread Alexey Kodanev
The last case label can write two buffers 'mc_reg_address[j]' and 'mc_data[j]' with 'j' offset equal to SMC_NISLANDS_MC_REGISTER_ARRAY_SIZE since there are no checks for this value in both case labels after the last 'j++'. Instead of changing '>' to '>=' there, add the bounds check at the start of