Skip to content
Heist/ feed
Back to feed
UnratedFix available

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

Type: advisorySources: OSV

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.

Products
Kernel
Affected versions
Not specified
Fixed versions
4.14.291, 4.19.256, 5.10.137, 5.15.61, 5.18.18, 5.19.2, 5.4.211
CVEs
CVE-2022-50185
Confirmed fixed CVEs
Not specified
Updated in this feed
2 Nov 2026, 20:35 UTC · Revision 1

Source evidence

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

core-osv · Original source

Published 18 Jun 2025, 11:03 UTC

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.

osv:CVE-2022-50185

Kernel

Fixed versions: 4.14.291, 4.19.256, 5.4.211, 5.10.137, 5.15.61, 5.18.18, 5.19.2

Complete source record
{
  "id": "771851faa50299e5fe52fe9277eea90580a1042a3682ac9875c75dbc48b04b53",
  "url": "https://osv.dev/vulnerability/CVE-2022-50185",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "drm/radeon: fix potential buffer overflow in ni_set_mc_special_registers()",
    "summary": "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.",
    "evidence": "osv:CVE-2022-50185",
    "products": [
      {
        "name": {
          "value": "Kernel",
          "evidence": "/affected/1/package/name"
        },
        "prerequisites": [],
        "fixed_versions": [
          {
            "value": "4.14.291",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "4.19.256",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.4.211",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.10.137",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.15.61",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.18.18",
            "evidence": "/affected/1/ranges"
          },
          {
            "value": "5.19.2",
            "evidence": "/affected/1/ranges"
          }
        ],
        "affected_versions": []
      }
    ],
    "severity": "unknown",
    "structured": {
      "id": "CVE-2022-50185",
      "aliases": [
        "CVE-2022-50185"
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "type": "GIT",
              "events": [
                {
                  "introduced": "69e0b57a91adca2e3eb56ed4db39ab90f3ae1043"
                },
                {
                  "fixed": "ea73869df6ef386fc0feeb28ff66742ca835b18f"
                },
                {
                  "fixed": "1f341053852be76f82610ce47a505d930512f05c"
                },
                {
                  "fixed": "db1a9add3f90ff1c641974d5bb910c16b87af4ef"
                },
                {
                  "fixed": "8508d6d23a247c29792ce2fc0df3f3404d6a6a80"
                },
                {
                  "fixed": "deb603c5928e546609c0d5798e231d0205748943"
                },
                {
                  "fixed": "782e413e38dffd37cc85b08b1ccb982adb4a93ce"
                },
                {
                  "fixed": "9faff03617afeced1c4e5daa89e79b3906374342"
                },
                {
                  "fixed": "136f614931a2bb73616b292cf542da3a18daefd5"
                }
              ]
            }
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50185.json"
          }
        },
        {
          "ranges": [
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "3.11.0"
                },
                {
                  "fixed": "4.14.291"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.15.0"
                },
                {
                  "fixed": "4.19.256"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "4.20.0"
                },
                {
                  "fixed": "5.4.211"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.5.0"
                },
                {
                  "fixed": "5.10.137"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.11.0"
                },
                {
                  "fixed": "5.15.61"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.16.0"
                },
                {
                  "fixed": "5.18.18"
                }
              ]
            },
            {
              "type": "ECOSYSTEM",
              "events": [
                {
                  "introduced": "5.19.0"
                },
                {
                  "fixed": "5.19.2"
                }
              ]
            }
          ],
          "package": {
            "name": "Kernel",
            "ecosystem": "Linux"
          },
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50185.json"
          }
        }
      ],
      "modified": "2026-10-28T02:30:23.558376961Z",
      "provider": "osv",
      "references": [
        "https://git.kernel.org/stable/c/136f614931a2bb73616b292cf542da3a18daefd5",
        "https://git.kernel.org/stable/c/1f341053852be76f82610ce47a505d930512f05c",
        "https://git.kernel.org/stable/c/782e413e38dffd37cc85b08b1ccb982adb4a93ce",
        "https://git.kernel.org/stable/c/8508d6d23a247c29792ce2fc0df3f3404d6a6a80",
        "https://git.kernel.org/stable/c/9faff03617afeced1c4e5daa89e79b3906374342",
        "https://git.kernel.org/stable/c/db1a9add3f90ff1c641974d5bb910c16b87af4ef",
        "https://git.kernel.org/stable/c/deb603c5928e546609c0d5798e231d0205748943",
        "https://git.kernel.org/stable/c/ea73869df6ef386fc0feeb28ff66742ca835b18f",
        "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50185.json",
        "https://nvd.nist.gov/vuln/detail/CVE-2022-50185",
        "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"
      ],
      "provider_metadata": {
        "cna_assigner": "Linux",
        "osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50185.json"
      }
    },
    "related_cves": [
      {
        "value": "CVE-2022-50185",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": null
  },
  "source_id": "core-osv",
  "document_id": 489907,
  "published_at": "2025-06-18T11:03:32.843+00:00"
}