{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2023-52687",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2023-52687"
  ],
  "published": "2024-05-17T14:32:10Z",
  "summary": "crypto: safexcel - Add error handling for dma_map_sg() calls",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\ncrypto: safexcel - Add error handling for dma_map_sg() calls\n\nMacro dma_map_sg() may return 0 on error. This patch enables\nchecks in case of the macro failure and ensures unmapping of\npreviously mapped buffers with dma_unmap_sg().\n\nFound by Linux Verification Center (linuxtesting.org) with static\nanalysis tool SVACE.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:N/AC:L/PR:N/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.75",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2023-52687"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/4c0ac81a172a69a7733290915276672787e904ec"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/8084b788c2fb1260f7d44c032d5124680b20d2b2"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/fc0b785802b856566df3ac943e38a072557001c4"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/87e02063d07708cac5bfe9fd3a6a242898758ac8"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:24:39Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 9.8,
      "cvss_v3_severity": "Critical",
      "scenario": "AV:N - The Inside Secure EIP97/EIP197 lookaside engine on Marvell Armada and MediaTek MT7986 networking appliances accelerates IPsec AEAD algorithms (gcm(aes), authenc(hmac(sha*),cbc(aes))) at cra_priority 300, so inbound ESP hits esp_input\u2192crypto_aead_decrypt\u2192safexcel_send_req\u2192dma_map_sg over the network before authentication completes.\nAC:L - A remote or local attacker can induce dma_map_sg() failure via memory/IOVA/swiotlb exhaustion (large multi-frag ESP floods or concurrent AF_ALG requests); once mapping fails the driver deterministically programs the engine with stale/unmapped SG DMA addresses with no race to win.\nPR:N - Crafted ESP packets to an existing IPsec SA exercise the vulnerable path with no privileges on the target; AEAD decrypt (including dma_map_sg) runs as part of packet processing before authenticity is established.\nUI:N - Exploitation requires only attacker-sent ESP (or AF_ALG) crypto requests; no victim user action such as mounting a filesystem or opening a file is needed.\nS:U - Impact is host-kernel memory corruption/DoS under the same kernel security authority; this is not a guest-to-host escape or intentional IOMMU isolation bypass across separate authorities.\nC:H - On dma-direct partial map failure, successfully mapped SG entries are unmapped but dma_address is left stale, so the engine DMAs from recycled pages (use-after-unmap); with separate src/dst, a failed src map plus successful dst map can encrypt unintended physical memory into attacker-readable output under a known key.\nI:H - The same stale/unmapped DMA addresses are used for DMA_FROM_DEVICE/BIDIRECTIONAL result writes, so the crypto engine writes into memory that may have been reused by other kernel subsystems, enabling arbitrary corruption and control-flow hijack primitives.\nA:H - Programming the EIP97/EIP197 with unmapped or DMA_MAPPING_ERROR addresses causes bus/IOMMU faults, driver failures, and kernel oops/panic, fully denying service on affected appliances."
    }
  }
}
