{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-37801",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2025-37801"
  ],
  "published": "2025-05-08T06:39:36Z",
  "summary": "spi: spi-imx: Add check for spi_imx_setupxfer()",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nspi: spi-imx: Add check for spi_imx_setupxfer()\n\nAdd check for the return value of spi_imx_setupxfer().\nspi_imx->rx and spi_imx->tx function pointer can be NULL when\nspi_imx_setupxfer() return error, and make NULL pointer dereference.\n\n Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000\n Call trace:\n  0x0\n  spi_imx_pio_transfer+0x50/0xd8\n  spi_imx_transfer_one+0x18c/0x858\n  spi_transfer_one_message+0x43c/0x790\n  __spi_pump_transfer_message+0x238/0x5d4\n  __spi_sync+0x2b0/0x454\n  spi_write_then_read+0x11c/0x200",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
    }
  ],
  "affected": [
    {
      "package": {
        "ecosystem": "Raspberry Pi OS:12",
        "name": "linux"
      },
      "versions": [
        "1:6.1.47-1+rpt4"
      ],
      "ecosystem_specific": {
        "binaries": [
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-2712",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v6",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v7l",
            "binary_version": "1:6.1.47-1+rpt4"
          },
          {
            "binary_name": "linux-image-6.1.0-rpi3-rpi-v8",
            "binary_version": "1:6.1.47-1+rpt4"
          }
        ]
      },
      "database_specific": {
        "per_version": {
          "1:6.1.47-1+rpt4": {
            "linux_commit": "655fc658a15ae7a6f37103754adb39ba52a9a14e",
            "upstream_version": "6.1.47",
            "assessment": "commit ancestry (strak rule)",
            "upstream_fixed": "6.1.136",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2025-37801"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/2fea0d6d7b5d27fbf55512d51851ba0a346ede52"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/2b4479eb462ecb39001b38dfb331fc6028dedac8"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/185d376875ea6fb4256b9dc97ee0b4d2b0fdd399"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/055ef73bb1afc3f783a9a13b496770a781964a07"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/951a04ab3a2db4029debfa48d380ef834b93207e"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T12:19:11Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The vulnerable path is reached from a local process issuing write()/read()/SPI_IOC_MESSAGE on /dev/spidevB.C, or from an in-kernel SPI protocol driver via spi_write_then_read(); there is no network or remote-peer input involved.\nAC:L - On an affected board (an i.MX SPI slave node lacking spi-max-frequency, which spi-imx never compensates for since it sets no controller->max_speed_hz) every transfer without an explicit speed deterministically takes the unchecked error path \u2014 no race, no memory-layout luck, and the attacker fully controls transfer speed_hz, bits_per_word, len and word_delay through a single ioctl.\nPR:L - An ordinary unprivileged local user with access to the spidev character device (routinely granted via an \"spi\" group on embedded/industrial i.MX deployments) can submit the crafted spi_ioc_transfer array; no CAP_SYS_ADMIN or root is needed.\nUI:N - The attacker performs the ioctl/write themselves; no action by another user or administrator is required.\nS:U - The corruption and crash are confined to the kernel of the same system; no VM, IOMMU, or other security-authority boundary is crossed.\nC:H - The stale spi_imx->tx/bits_per_word state left by the unchecked error causes spi_imx->count to underflow, so spi_imx_buf_tx_u32() reads far past the transfer's TX buffer and shifts adjacent kernel heap memory out onto the SPI bus, where an attacker-controlled or observable peripheral can read it.\nI:H - The same count underflow makes spi_imx_buf_rx_u32() write 4 bytes per FIFO word past the end of the RX buffer, repeatedly from spi_imx_isr(), giving an unbounded heap out-of-bounds write with data sourced from the SPI RX FIFO.\nA:H - In the common case spi_imx->tx is NULL and spi_imx_push() jumps to address 0, producing a kernel NULL pointer dereference oops/panic exactly as shown in the fix's backtrace; the OOB-write variant likewise corrupts the heap and crashes the system."
    }
  }
}
