« List of all CVEs

CVE-2022-50185

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

Published: 6/18/2025 Last updated: 6/18/2025 Reserved: 6/18/2025

In the Linux kernel, the following vulnerability has been resolved: drm/radeon: fix potential buffer overflow in ni_set_mc_special_registers() 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 the second 'case' (the first one already has it). Also, remove redundant last checks for 'j' index bigger than array size. The expression is always false. Moreover, before or after the patch 'table->last' can be equal to SMC_NISLANDS_MC_REGISTER_ARRAY_SIZE and it seems it can be a valid value. Detected using the static analysis tool - Svace.

CNA assigner: Linux (416baaa9-dc9f-4396-8d5f-8c081fb06d67) Requested by: n/a

Opam packages affected (10)

conf-bpftool conf-libbpf conf-linux-libc-dev hvsock mirage-block-unix solo5 solo5-bindings-hvt solo5-bindings-spt solo5-cross-aarch64 solo5-kernel-ukvm

Products affected (2)

Product Vendor Version
Linux Linux >= 2.2, < 2.3.18
Linux Linux SA9000P

References (8)