{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-43877",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-43877"
  ],
  "published": "2024-08-21T00:07:46Z",
  "summary": "media: pci: ivtv: Add check for DMA map result",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nmedia: pci: ivtv: Add check for DMA map result\n\nIn case DMA fails, 'dma->SG_length' is 0. This value is later used to\naccess 'dma->SGarray[dma->SG_length - 1]', which will cause out of\nbounds access.\n\nAdd check to return early on invalid value. Adjust warnings accordingly.\n\nFound by Linux Verification Center (linuxtesting.org) with SVACE.",
  "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.103",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-43877"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/38f72c7e7c6b55614f9407555fd5ce9d019b0fa4"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/81d0664bed91a858c7b50c263954b59d65f1b414"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/24062aa7407091dee3e45a8e8037df437e848718"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/3d8fd92939e21ff0d45100ab208f8124af79402a"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/c766065e8272085ea9c436414b7ddf1f12e7787b"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/629913d6d79508b166c66e07e4857e20233d85a9"
    }
  ],
  "database_specific": {
    "source": "https://git.kernel.org/pub/scm/linux/security/vulns.git",
    "upstream_modified": "2026-08-05T11:52:36Z",
    "severity": {
      "source": "kernel CNA",
      "cvss_v3_score": 7.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The vulnerable code is reached only through local device nodes \u2014 `write()`/`ioctl(IVTVFB_IOC_DMA_FRAME)` on `/dev/fbN` and `write()`/`ioctl(IVTV_IOC_DMA_FRAME)` on the ivtv decoder video node. No remote or adjacent-network input reaches this path.\nAC:L - The attacker fully controls the userspace buffer address and the transfer size (up to 704 pages per call) and can retry the operation in an unbounded loop; because the card is 32-bit DMA-masked, every high page consumes shared swiotlb/32-bit IOVA resources that the attacker can pressure and exhaust, and once `dma_map_sg()` returns 0 the out-of-bounds write is deterministic.\nPR:L - There is no `capable()` or other privilege check anywhere along the path \u2014 access is governed solely by permissions on `/dev/video*` and `/dev/fb*`, which are held by ordinary console/desktop users in the `video` group and by non-root media daemons on set-top-box and embedded appliances.\nUI:N - The attacker triggers the bug entirely from their own process with a single `write()` or `ioctl()` call; no action by any other user is required.\nS:U - The corruption and its consequences stay within the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed by the negative-index write itself.\nC:H - The corrupted `bouncemap[703]` page pointer is subsequently used as a bounce-buffer source, and the driver additionally programs the card with a stale SG array of already-unmapped DMA addresses, causing kernel memory the driver no longer owns to be copied into decoder RAM that userspace can read back \u2014 a memory-corruption primitive leveragable for arbitrary kernel disclosure.\nI:H - This is an out-of-bounds write that ORs bit 63 into an adjacent `struct page *`, and that poisoned pointer is later fed to `page_address()` + `memcpy()` with attacker-controlled data and to `__free_page()` \u2014 yielding a wild kernel write and page-allocator corruption suitable for control-flow hijacking.\nA:H - The failed transfer leaves no SG entry tagged with the completion-interrupt bit and arms no DMA timeout timer, so the caller loops forever in `schedule()` while holding `itv->udma.lock`, permanently wedging the driver; the wild `__free_page()`/`page_address()` dereferences additionally produce a kernel oops."
    }
  }
}
