CVE-2021-47282 (GCVE-0-2021-47282)

Vulnerability from cvelistv5 – Published: 2024-05-21 14:20 – Updated: 2026-08-05 08:47
VLAI
Title
spi: bcm2835: Fix out-of-bounds access with more than 4 slaves
Summary
In the Linux kernel, the following vulnerability has been resolved: spi: bcm2835: Fix out-of-bounds access with more than 4 slaves Commit 571e31fa60b3 ("spi: bcm2835: Cache CS register value for ->prepare_message()") limited the number of slaves to 3 at compile-time. The limitation was necessitated by a statically-sized array prepare_cs[] in the driver private data which contains a per-slave register value. The commit sought to enforce the limitation at run-time by setting the controller's num_chipselect to 3: Slaves with a higher chipselect are rejected by spi_add_device(). However the commit neglected that num_chipselect only limits the number of *native* chipselects. If GPIO chipselects are specified in the device tree for more than 3 slaves, num_chipselect is silently raised by of_spi_get_gpio_numbers() and the result are out-of-bounds accesses to the statically-sized array prepare_cs[]. As a bandaid fix which is backportable to stable, raise the number of allowed slaves to 24 (which "ought to be enough for anybody"), enforce the limitation on slave ->setup and revert num_chipselect to 3 (which is the number of native chipselects supported by the controller). An upcoming for-next commit will allow an arbitrary number of slaves.
SSVC
Exploitation: none Automatable: no Technical Impact: partial
CISA Coordinator · CISA-ADP (v2.0.3)
Decision recorded 2024-05-23 17:10 UTC
Impacted products
Vendor Product Version
Linux Linux Affected: 571e31fa60b3697d5db26140e16d5c45c51c9815 , < b5502580cf958b094f3b69dfe4eece90eae01fbc (git)
Affected: 571e31fa60b3697d5db26140e16d5c45c51c9815 , < 82a8ffba54d31e97582051cb56ba1f988018681e (git)
Affected: 571e31fa60b3697d5db26140e16d5c45c51c9815 , < 01415ff85a24308059e06ca3e97fd7bf75648690 (git)
Affected: 571e31fa60b3697d5db26140e16d5c45c51c9815 , < 13817d466eb8713a1ffd254f537402f091d48444 (git)
Create a notification for this product.
Linux Linux Affected: 5.4
Unaffected: 0 , < 5.4 (semver)
Unaffected: 5.4.126 , ≤ 5.4.* (semver)
Unaffected: 5.10.44 , ≤ 5.10.* (semver)
Unaffected: 5.12.11 , ≤ 5.12.* (semver)
Unaffected: 5.13 , ≤ * (original_commit_for_fix)
Create a notification for this product.
Show details on NVD website

{
  "containers": {
    "adp": [
      {
        "metrics": [
          {
            "other": {
              "content": {
                "id": "CVE-2021-47282",
                "options": [
                  {
                    "Exploitation": "none"
                  },
                  {
                    "Automatable": "no"
                  },
                  {
                    "Technical Impact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-05-23T17:10:17.644618Z",
                "version": "2.0.3"
              },
              "type": "ssvc"
            }
          }
        ],
        "providerMetadata": {
          "dateUpdated": "2024-06-04T17:14:52.641Z",
          "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
          "shortName": "CISA-ADP"
        },
        "title": "CISA ADP Vulnrichment"
      },
      {
        "providerMetadata": {
          "dateUpdated": "2024-08-04T05:32:08.008Z",
          "orgId": "af854a3a-2127-422b-91ae-364da2661108",
          "shortName": "CVE"
        },
        "references": [
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/b5502580cf958b094f3b69dfe4eece90eae01fbc"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/82a8ffba54d31e97582051cb56ba1f988018681e"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/01415ff85a24308059e06ca3e97fd7bf75648690"
          },
          {
            "tags": [
              "x_transferred"
            ],
            "url": "https://git.kernel.org/stable/c/13817d466eb8713a1ffd254f537402f091d48444"
          }
        ],
        "title": "CVE Program Container"
      }
    ],
    "cna": {
      "affected": [
        {
          "defaultStatus": "unaffected",
          "product": "Linux",
          "programFiles": [
            "drivers/spi/spi-bcm2835.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "lessThan": "b5502580cf958b094f3b69dfe4eece90eae01fbc",
              "status": "affected",
              "version": "571e31fa60b3697d5db26140e16d5c45c51c9815",
              "versionType": "git"
            },
            {
              "lessThan": "82a8ffba54d31e97582051cb56ba1f988018681e",
              "status": "affected",
              "version": "571e31fa60b3697d5db26140e16d5c45c51c9815",
              "versionType": "git"
            },
            {
              "lessThan": "01415ff85a24308059e06ca3e97fd7bf75648690",
              "status": "affected",
              "version": "571e31fa60b3697d5db26140e16d5c45c51c9815",
              "versionType": "git"
            },
            {
              "lessThan": "13817d466eb8713a1ffd254f537402f091d48444",
              "status": "affected",
              "version": "571e31fa60b3697d5db26140e16d5c45c51c9815",
              "versionType": "git"
            }
          ]
        },
        {
          "defaultStatus": "affected",
          "product": "Linux",
          "programFiles": [
            "drivers/spi/spi-bcm2835.c"
          ],
          "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
          "vendor": "Linux",
          "versions": [
            {
              "status": "affected",
              "version": "5.4"
            },
            {
              "lessThan": "5.4",
              "status": "unaffected",
              "version": "0",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.4.*",
              "status": "unaffected",
              "version": "5.4.126",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.10.*",
              "status": "unaffected",
              "version": "5.10.44",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "5.12.*",
              "status": "unaffected",
              "version": "5.12.11",
              "versionType": "semver"
            },
            {
              "lessThanOrEqual": "*",
              "status": "unaffected",
              "version": "5.13",
              "versionType": "original_commit_for_fix"
            }
          ]
        }
      ],
      "cpeApplicability": [
        {
          "nodes": [
            {
              "cpeMatch": [
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.4.126",
                  "versionStartIncluding": "5.4",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.10.44",
                  "versionStartIncluding": "5.4",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.12.11",
                  "versionStartIncluding": "5.4",
                  "vulnerable": true
                },
                {
                  "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                  "versionEndExcluding": "5.13",
                  "versionStartIncluding": "5.4",
                  "vulnerable": true
                }
              ],
              "negate": false,
              "operator": "OR"
            }
          ]
        }
      ],
      "descriptions": [
        {
          "lang": "en",
          "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nspi: bcm2835: Fix out-of-bounds access with more than 4 slaves\n\nCommit 571e31fa60b3 (\"spi: bcm2835: Cache CS register value for\n-\u003eprepare_message()\") limited the number of slaves to 3 at compile-time.\nThe limitation was necessitated by a statically-sized array prepare_cs[]\nin the driver private data which contains a per-slave register value.\n\nThe commit sought to enforce the limitation at run-time by setting the\ncontroller\u0027s num_chipselect to 3:  Slaves with a higher chipselect are\nrejected by spi_add_device().\n\nHowever the commit neglected that num_chipselect only limits the number\nof *native* chipselects.  If GPIO chipselects are specified in the\ndevice tree for more than 3 slaves, num_chipselect is silently raised by\nof_spi_get_gpio_numbers() and the result are out-of-bounds accesses to\nthe statically-sized array prepare_cs[].\n\nAs a bandaid fix which is backportable to stable, raise the number of\nallowed slaves to 24 (which \"ought to be enough for anybody\"), enforce\nthe limitation on slave -\u003esetup and revert num_chipselect to 3 (which is\nthe number of native chipselects supported by the controller).\nAn upcoming for-next commit will allow an arbitrary number of slaves."
        }
      ],
      "metrics": [
        {
          "cvssV3_1": {
            "baseScore": 7.8,
            "baseSeverity": "HIGH",
            "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
            "version": "3.1"
          },
          "scenarios": [
            {
              "lang": "en",
              "value": "AV:L - The bcm2835 SPI host driver is reached through local device registration and SPI transfers (e.g. spidev or bound slave drivers) after the controller is instantiated from the platform/device tree; it is not reachable via network protocols or by merely attaching a hot-plugged peripheral.\nAC:L - Once more than four GPIO chipselects are present in the device tree, of_spi_get_gpio_numbers() raises num_chipselect and spi_add_device() accepts high CS indices, so bcm2835_spi_setup()/prepare_message()/DMA paths reliably perform the out-of-bounds accesses with no race or other attacker-uncontrollable condition.\nPR:L - On affected Raspberry Pi and industrial bcm2835 systems, unprivileged local users can open SPI device nodes and trigger transfers that exercise the OOB paths; DT configuration establishing the vulnerable CS count is a realistic deployment precondition rather than a requirement for high privileges at exploit time.\nUI:N - No separate victim action is required; registration at probe and subsequent SPI I/O invoke the vulnerable code without interactive user cooperation.\nS:U - The corruption is confined to kernel memory in the same SPI controller privilege domain and does not cross a VM, IOMMU, or other security authority boundary.\nC:H - Out-of-bounds reads of prepare_cs[] and adjacent bcm2835_spi fields, plus heap corruption from clear_rx_cs[] writes past the allocation, are memory-corruption primitives that can be leveraged for information disclosure.\nI:H - Out-of-bounds writes into prepare_cs[] (overwriting later struct fields such as pointers) and past clear_rx_cs[] into the heap, together with submission of invalid clear_rx_desc[] DMA descriptors, enable integrity compromise and control-flow/DMA abuse.\nA:H - Invalid pointer and DMA descriptor use from the corrupted bcm2835_spi state can cause kernel oops/panic or hangs, yielding a full availability impact."
            }
          ]
        }
      ],
      "providerMetadata": {
        "dateUpdated": "2026-08-05T08:47:04.965Z",
        "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "shortName": "Linux"
      },
      "references": [
        {
          "url": "https://git.kernel.org/stable/c/b5502580cf958b094f3b69dfe4eece90eae01fbc"
        },
        {
          "url": "https://git.kernel.org/stable/c/82a8ffba54d31e97582051cb56ba1f988018681e"
        },
        {
          "url": "https://git.kernel.org/stable/c/01415ff85a24308059e06ca3e97fd7bf75648690"
        },
        {
          "url": "https://git.kernel.org/stable/c/13817d466eb8713a1ffd254f537402f091d48444"
        }
      ],
      "title": "spi: bcm2835: Fix out-of-bounds access with more than 4 slaves",
      "x_generator": {
        "engine": "bippy-1.2.0"
      }
    }
  },
  "cveMetadata": {
    "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
    "assignerShortName": "Linux",
    "cveId": "CVE-2021-47282",
    "datePublished": "2024-05-21T14:20:08.155Z",
    "dateReserved": "2024-05-21T13:27:52.128Z",
    "dateUpdated": "2026-08-05T08:47:04.965Z",
    "state": "PUBLISHED"
  },
  "dataType": "CVE_RECORD",
  "dataVersion": "5.2",
  "vulnerability-lookup:meta": {
    "epss": {
      "cve": "CVE-2021-47282",
      "date": "2026-10-22",
      "epss": "0.00233",
      "percentile": "0.1333"
    },
    "nvd": {
      "cve": {
        "affected": [
          {
            "affectedData": [
              {
                "defaultStatus": "unaffected",
                "product": "Linux",
                "programFiles": [
                  "drivers/spi/spi-bcm2835.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "lessThan": "b5502580cf958b094f3b69dfe4eece90eae01fbc",
                    "status": "affected",
                    "version": "571e31fa60b3697d5db26140e16d5c45c51c9815",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "82a8ffba54d31e97582051cb56ba1f988018681e",
                    "status": "affected",
                    "version": "571e31fa60b3697d5db26140e16d5c45c51c9815",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "01415ff85a24308059e06ca3e97fd7bf75648690",
                    "status": "affected",
                    "version": "571e31fa60b3697d5db26140e16d5c45c51c9815",
                    "versionType": "git"
                  },
                  {
                    "lessThan": "13817d466eb8713a1ffd254f537402f091d48444",
                    "status": "affected",
                    "version": "571e31fa60b3697d5db26140e16d5c45c51c9815",
                    "versionType": "git"
                  }
                ]
              },
              {
                "defaultStatus": "affected",
                "product": "Linux",
                "programFiles": [
                  "drivers/spi/spi-bcm2835.c"
                ],
                "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                "vendor": "Linux",
                "versions": [
                  {
                    "status": "affected",
                    "version": "5.4"
                  },
                  {
                    "lessThan": "5.4",
                    "status": "unaffected",
                    "version": "0",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "5.4.*",
                    "status": "unaffected",
                    "version": "5.4.126",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "5.10.*",
                    "status": "unaffected",
                    "version": "5.10.44",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "5.12.*",
                    "status": "unaffected",
                    "version": "5.12.11",
                    "versionType": "semver"
                  },
                  {
                    "lessThanOrEqual": "*",
                    "status": "unaffected",
                    "version": "5.13",
                    "versionType": "original_commit_for_fix"
                  }
                ]
              }
            ],
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67"
          }
        ],
        "configurations": [
          {
            "nodes": [
              {
                "cpeMatch": [
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "6D23A3FF-8CE4-41A1-9E6A-8138FDC413F6",
                    "versionEndExcluding": "5.4.126",
                    "versionStartIncluding": "5.4",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "DA547B08-9D25-467B-AD0D-8460FE4EE70D",
                    "versionEndExcluding": "5.10.44",
                    "versionStartIncluding": "5.5",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                    "matchCriteriaId": "F914A757-FAFD-407E-9031-21F66635D5EA",
                    "versionEndExcluding": "5.12.11",
                    "versionStartIncluding": "5.11",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:5.13:rc1:*:*:*:*:*:*",
                    "matchCriteriaId": "0CBAD0FC-C281-4666-AB2F-F8E6E1165DF7",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:5.13:rc2:*:*:*:*:*:*",
                    "matchCriteriaId": "96AC23B2-D46A-49D9-8203-8E1BEDCA8532",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:5.13:rc3:*:*:*:*:*:*",
                    "matchCriteriaId": "DA610E30-717C-4700-9F77-A3C9244F3BFD",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:5.13:rc4:*:*:*:*:*:*",
                    "matchCriteriaId": "1ECD33F5-85BE-430B-8F86-8D7BD560311D",
                    "vulnerable": true
                  },
                  {
                    "criteria": "cpe:2.3:o:linux:linux_kernel:5.13:rc5:*:*:*:*:*:*",
                    "matchCriteriaId": "CF351855-2437-4CF5-AD7C-BDFA51F27683",
                    "vulnerable": true
                  }
                ],
                "negate": false,
                "operator": "OR"
              }
            ]
          }
        ],
        "cveTags": [],
        "descriptions": [
          {
            "lang": "en",
            "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nspi: bcm2835: Fix out-of-bounds access with more than 4 slaves\n\nCommit 571e31fa60b3 (\"spi: bcm2835: Cache CS register value for\n-\u003eprepare_message()\") limited the number of slaves to 3 at compile-time.\nThe limitation was necessitated by a statically-sized array prepare_cs[]\nin the driver private data which contains a per-slave register value.\n\nThe commit sought to enforce the limitation at run-time by setting the\ncontroller\u0027s num_chipselect to 3:  Slaves with a higher chipselect are\nrejected by spi_add_device().\n\nHowever the commit neglected that num_chipselect only limits the number\nof *native* chipselects.  If GPIO chipselects are specified in the\ndevice tree for more than 3 slaves, num_chipselect is silently raised by\nof_spi_get_gpio_numbers() and the result are out-of-bounds accesses to\nthe statically-sized array prepare_cs[].\n\nAs a bandaid fix which is backportable to stable, raise the number of\nallowed slaves to 24 (which \"ought to be enough for anybody\"), enforce\nthe limitation on slave -\u003esetup and revert num_chipselect to 3 (which is\nthe number of native chipselects supported by the controller).\nAn upcoming for-next commit will allow an arbitrary number of slaves."
          },
          {
            "lang": "es",
            "value": "En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: spi: bcm2835: corrige el acceso fuera de los l\u00edmites con m\u00e1s de 4 esclavos. La confirmaci\u00f3n 571e31fa60b3 (\"spi: bcm2835: valor de registro CS de cach\u00e9 para -\u0026gt;prepare_message()\") limit\u00f3 el n\u00famero de esclavos a 3 en tiempo de compilaci\u00f3n. La limitaci\u00f3n fue necesaria por una matriz de tama\u00f1o est\u00e1tico prepare_cs[] en los datos privados del controlador que contiene un valor de registro por esclavo. La confirmaci\u00f3n buscaba hacer cumplir la limitaci\u00f3n en tiempo de ejecuci\u00f3n estableciendo num_chipselect del controlador en 3: spi_add_device() rechaza los esclavos con una selecci\u00f3n de chip m\u00e1s alta. Sin embargo, la confirmaci\u00f3n omiti\u00f3 que num_chipselect solo limita el n\u00famero de selecciones de chips *nativas*. Si se especifican selecciones de chips GPIO en el \u00e1rbol de dispositivos para m\u00e1s de 3 esclavos, of_spi_get_gpio_numbers() genera silenciosamente num_chipselect y el resultado son accesos fuera de los l\u00edmites a la matriz de tama\u00f1o est\u00e1tico prepare_cs[]. Como soluci\u00f3n curita que se puede volver a transferir a estable, aumente la cantidad de esclavos permitidos a 24 (lo que \"deber\u00eda ser suficiente para cualquiera\"), aplique la limitaci\u00f3n en esclavo -\u0026gt; configuraci\u00f3n y revierta num_chipselect a 3 (que es la cantidad de nativos selecciones de chips admitidas por el controlador). Una pr\u00f3xima confirmaci\u00f3n para la pr\u00f3xima permitir\u00e1 una cantidad arbitraria de esclavos."
          }
        ],
        "id": "CVE-2021-47282",
        "lastModified": "2026-08-04T10:16:56.300",
        "metrics": {
          "cvssMetricV31": [
            {
              "cvssData": {
                "attackComplexity": "LOW",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 7.8,
                "baseSeverity": "HIGH",
                "confidentialityImpact": "HIGH",
                "integrityImpact": "HIGH",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.8,
              "impactScore": 5.9,
              "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
              "type": "Secondary"
            },
            {
              "cvssData": {
                "attackComplexity": "LOW",
                "attackVector": "LOCAL",
                "availabilityImpact": "HIGH",
                "baseScore": 7.8,
                "baseSeverity": "HIGH",
                "confidentialityImpact": "HIGH",
                "integrityImpact": "HIGH",
                "privilegesRequired": "LOW",
                "scope": "UNCHANGED",
                "userInteraction": "NONE",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                "version": "3.1"
              },
              "exploitabilityScore": 1.8,
              "impactScore": 5.9,
              "source": "nvd@nist.gov",
              "type": "Primary"
            }
          ],
          "ssvcV203": [
            {
              "source": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
              "ssvcData": {
                "id": "CVE-2021-47282",
                "options": [
                  {
                    "exploitation": "none"
                  },
                  {
                    "automatable": "no"
                  },
                  {
                    "technicalImpact": "partial"
                  }
                ],
                "role": "CISA Coordinator",
                "timestamp": "2024-05-23T17:10:17.644618Z",
                "version": "2.0.3"
              }
            }
          ]
        },
        "published": "2024-05-21T15:15:16.430",
        "references": [
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/01415ff85a24308059e06ca3e97fd7bf75648690"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/13817d466eb8713a1ffd254f537402f091d48444"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/82a8ffba54d31e97582051cb56ba1f988018681e"
          },
          {
            "source": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/b5502580cf958b094f3b69dfe4eece90eae01fbc"
          },
          {
            "source": "af854a3a-2127-422b-91ae-364da2661108",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/01415ff85a24308059e06ca3e97fd7bf75648690"
          },
          {
            "source": "af854a3a-2127-422b-91ae-364da2661108",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/13817d466eb8713a1ffd254f537402f091d48444"
          },
          {
            "source": "af854a3a-2127-422b-91ae-364da2661108",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/82a8ffba54d31e97582051cb56ba1f988018681e"
          },
          {
            "source": "af854a3a-2127-422b-91ae-364da2661108",
            "tags": [
              "Patch"
            ],
            "url": "https://git.kernel.org/stable/c/b5502580cf958b094f3b69dfe4eece90eae01fbc"
          }
        ],
        "sourceIdentifier": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "vulnStatus": "Modified",
        "weaknesses": [
          {
            "description": [
              {
                "lang": "en",
                "value": "CWE-787"
              }
            ],
            "source": "nvd@nist.gov",
            "type": "Primary"
          }
        ]
      }
    },
    "redhat_vex": {
      "aggregate_severity": "Moderate",
      "current_release_date": "2026-09-28T00:04:35+00:00",
      "cve": "CVE-2021-47282",
      "id": "CVE-2021-47282",
      "initial_release_date": "2021-01-01T00:00:00+00:00",
      "product_status:known_not_affected": "198",
      "source": "Red Hat CSAF VEX",
      "status": "final",
      "title": "kernel: spi: bcm2835: Fix out-of-bounds access with more than 4 slaves",
      "url": "https://security.access.redhat.com/data/csaf/v2/vex/2021/cve-2021-47282.json",
      "version": "3"
    },
    "vulnrichment": {
      "containers": {
        "adp": [
          {
            "providerMetadata": {
              "dateUpdated": "2024-08-04T05:32:08.008Z",
              "orgId": "af854a3a-2127-422b-91ae-364da2661108",
              "shortName": "CVE"
            },
            "references": [
              {
                "tags": [
                  "x_transferred"
                ],
                "url": "https://git.kernel.org/stable/c/b5502580cf958b094f3b69dfe4eece90eae01fbc"
              },
              {
                "tags": [
                  "x_transferred"
                ],
                "url": "https://git.kernel.org/stable/c/82a8ffba54d31e97582051cb56ba1f988018681e"
              },
              {
                "tags": [
                  "x_transferred"
                ],
                "url": "https://git.kernel.org/stable/c/01415ff85a24308059e06ca3e97fd7bf75648690"
              },
              {
                "tags": [
                  "x_transferred"
                ],
                "url": "https://git.kernel.org/stable/c/13817d466eb8713a1ffd254f537402f091d48444"
              }
            ],
            "title": "CVE Program Container"
          },
          {
            "metrics": [
              {
                "other": {
                  "content": {
                    "id": "CVE-2021-47282",
                    "options": [
                      {
                        "Exploitation": "none"
                      },
                      {
                        "Automatable": "no"
                      },
                      {
                        "Technical Impact": "partial"
                      }
                    ],
                    "role": "CISA Coordinator",
                    "timestamp": "2024-05-23T17:10:17.644618Z",
                    "version": "2.0.3"
                  },
                  "type": "ssvc"
                }
              }
            ],
            "providerMetadata": {
              "dateUpdated": "2024-05-23T17:10:22.583Z",
              "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
              "shortName": "CISA-ADP"
            },
            "title": "CISA ADP Vulnrichment"
          }
        ],
        "cna": {
          "affected": [
            {
              "defaultStatus": "unaffected",
              "product": "Linux",
              "programFiles": [
                "drivers/spi/spi-bcm2835.c"
              ],
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "vendor": "Linux",
              "versions": [
                {
                  "lessThan": "b5502580cf958b094f3b69dfe4eece90eae01fbc",
                  "status": "affected",
                  "version": "571e31fa60b3697d5db26140e16d5c45c51c9815",
                  "versionType": "git"
                },
                {
                  "lessThan": "82a8ffba54d31e97582051cb56ba1f988018681e",
                  "status": "affected",
                  "version": "571e31fa60b3697d5db26140e16d5c45c51c9815",
                  "versionType": "git"
                },
                {
                  "lessThan": "01415ff85a24308059e06ca3e97fd7bf75648690",
                  "status": "affected",
                  "version": "571e31fa60b3697d5db26140e16d5c45c51c9815",
                  "versionType": "git"
                },
                {
                  "lessThan": "13817d466eb8713a1ffd254f537402f091d48444",
                  "status": "affected",
                  "version": "571e31fa60b3697d5db26140e16d5c45c51c9815",
                  "versionType": "git"
                }
              ]
            },
            {
              "defaultStatus": "affected",
              "product": "Linux",
              "programFiles": [
                "drivers/spi/spi-bcm2835.c"
              ],
              "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
              "vendor": "Linux",
              "versions": [
                {
                  "status": "affected",
                  "version": "5.4"
                },
                {
                  "lessThan": "5.4",
                  "status": "unaffected",
                  "version": "0",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "5.4.*",
                  "status": "unaffected",
                  "version": "5.4.126",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "5.10.*",
                  "status": "unaffected",
                  "version": "5.10.44",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "5.12.*",
                  "status": "unaffected",
                  "version": "5.12.11",
                  "versionType": "semver"
                },
                {
                  "lessThanOrEqual": "*",
                  "status": "unaffected",
                  "version": "5.13",
                  "versionType": "original_commit_for_fix"
                }
              ]
            }
          ],
          "cpeApplicability": [
            {
              "nodes": [
                {
                  "cpeMatch": [
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "5.4.126",
                      "versionStartIncluding": "5.4",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "5.10.44",
                      "versionStartIncluding": "5.4",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "5.12.11",
                      "versionStartIncluding": "5.4",
                      "vulnerable": true
                    },
                    {
                      "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                      "versionEndExcluding": "5.13",
                      "versionStartIncluding": "5.4",
                      "vulnerable": true
                    }
                  ],
                  "negate": false,
                  "operator": "OR"
                }
              ]
            }
          ],
          "descriptions": [
            {
              "lang": "en",
              "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nspi: bcm2835: Fix out-of-bounds access with more than 4 slaves\n\nCommit 571e31fa60b3 (\"spi: bcm2835: Cache CS register value for\n-\u003eprepare_message()\") limited the number of slaves to 3 at compile-time.\nThe limitation was necessitated by a statically-sized array prepare_cs[]\nin the driver private data which contains a per-slave register value.\n\nThe commit sought to enforce the limitation at run-time by setting the\ncontroller\u0027s num_chipselect to 3:  Slaves with a higher chipselect are\nrejected by spi_add_device().\n\nHowever the commit neglected that num_chipselect only limits the number\nof *native* chipselects.  If GPIO chipselects are specified in the\ndevice tree for more than 3 slaves, num_chipselect is silently raised by\nof_spi_get_gpio_numbers() and the result are out-of-bounds accesses to\nthe statically-sized array prepare_cs[].\n\nAs a bandaid fix which is backportable to stable, raise the number of\nallowed slaves to 24 (which \"ought to be enough for anybody\"), enforce\nthe limitation on slave -\u003esetup and revert num_chipselect to 3 (which is\nthe number of native chipselects supported by the controller).\nAn upcoming for-next commit will allow an arbitrary number of slaves."
            }
          ],
          "metrics": [
            {
              "cvssV3_1": {
                "baseScore": 7.8,
                "baseSeverity": "HIGH",
                "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                "version": "3.1"
              },
              "scenarios": [
                {
                  "lang": "en",
                  "value": "AV:L - The bcm2835 SPI host driver is reached through local device registration and SPI transfers (e.g. spidev or bound slave drivers) after the controller is instantiated from the platform/device tree; it is not reachable via network protocols or by merely attaching a hot-plugged peripheral.\nAC:L - Once more than four GPIO chipselects are present in the device tree, of_spi_get_gpio_numbers() raises num_chipselect and spi_add_device() accepts high CS indices, so bcm2835_spi_setup()/prepare_message()/DMA paths reliably perform the out-of-bounds accesses with no race or other attacker-uncontrollable condition.\nPR:L - On affected Raspberry Pi and industrial bcm2835 systems, unprivileged local users can open SPI device nodes and trigger transfers that exercise the OOB paths; DT configuration establishing the vulnerable CS count is a realistic deployment precondition rather than a requirement for high privileges at exploit time.\nUI:N - No separate victim action is required; registration at probe and subsequent SPI I/O invoke the vulnerable code without interactive user cooperation.\nS:U - The corruption is confined to kernel memory in the same SPI controller privilege domain and does not cross a VM, IOMMU, or other security authority boundary.\nC:H - Out-of-bounds reads of prepare_cs[] and adjacent bcm2835_spi fields, plus heap corruption from clear_rx_cs[] writes past the allocation, are memory-corruption primitives that can be leveraged for information disclosure.\nI:H - Out-of-bounds writes into prepare_cs[] (overwriting later struct fields such as pointers) and past clear_rx_cs[] into the heap, together with submission of invalid clear_rx_desc[] DMA descriptors, enable integrity compromise and control-flow/DMA abuse.\nA:H - Invalid pointer and DMA descriptor use from the corrupted bcm2835_spi state can cause kernel oops/panic or hangs, yielding a full availability impact."
                }
              ]
            }
          ],
          "providerMetadata": {
            "dateUpdated": "2026-08-05T08:47:04.965Z",
            "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
            "shortName": "Linux"
          },
          "references": [
            {
              "url": "https://git.kernel.org/stable/c/b5502580cf958b094f3b69dfe4eece90eae01fbc"
            },
            {
              "url": "https://git.kernel.org/stable/c/82a8ffba54d31e97582051cb56ba1f988018681e"
            },
            {
              "url": "https://git.kernel.org/stable/c/01415ff85a24308059e06ca3e97fd7bf75648690"
            },
            {
              "url": "https://git.kernel.org/stable/c/13817d466eb8713a1ffd254f537402f091d48444"
            }
          ],
          "title": "spi: bcm2835: Fix out-of-bounds access with more than 4 slaves",
          "x_generator": {
            "engine": "bippy-1.2.0"
          }
        }
      },
      "cveMetadata": {
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "assignerShortName": "Linux",
        "cveId": "CVE-2021-47282",
        "datePublished": "2024-05-21T14:20:08.155Z",
        "dateReserved": "2024-05-21T13:27:52.128Z",
        "dateUpdated": "2026-08-05T08:47:04.965Z",
        "state": "PUBLISHED"
      },
      "dataType": "CVE_RECORD",
      "dataVersion": "5.2"
    }
  }
}



Log in or create an account to share your comment.




Tags
Taxonomy of the tags.


Loading…

Loading…

Loading…

Forecast uses a logistic model when the trend is rising, or an exponential decay model when the trend is falling. Fitted via linearized least squares.

Sightings

Author Source Type Date Other

Nomenclature

  • Seen: The vulnerability was mentioned, discussed, or observed by the user.
  • Confirmed: The vulnerability has been validated from an analyst's perspective.
  • Published Proof of Concept: A public proof of concept is available for this vulnerability.
  • Exploited: The vulnerability was observed as exploited by the user who reported the sighting.
  • Patched: The vulnerability was observed as successfully patched by the user who reported the sighting.
  • Not exploited: The vulnerability was not observed as exploited by the user who reported the sighting.
  • Not confirmed: The user expressed doubt about the validity of the vulnerability.
  • Not patched: The vulnerability was not observed as successfully patched by the user who reported the sighting.

Loading…

Loading…

Loading…

Related by attack behaviour

Vulnerabilities whose description is nearest to this one in the vector space of the CIRCL/vulnerability-attack-technique-biencoder model. This is a similarity search over the bi-encoder space (plain cosine), not a classification, and it has no measured accuracy.


Loading…