{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2024-57804",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2024-57804"
  ],
  "published": "2025-01-11T12:40:52Z",
  "summary": "scsi: mpi3mr: Fix corrupt config pages PHY state is switched in sysfs",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\nscsi: mpi3mr: Fix corrupt config pages PHY state is switched in sysfs\n\nThe driver, through the SAS transport, exposes a sysfs interface to\nenable/disable PHYs in a controller/expander setup.  When multiple PHYs\nare disabled and enabled in rapid succession, the persistent and current\nconfig pages related to SAS IO unit/SAS Expander pages could get\ncorrupted.\n\nUse separate memory for each config request.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/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": null,
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2024-57804"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/869fdc6f0606060301aef648231e186c7c542f5a"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/711201a8b8334a397440ac0b859df0054e174bc9"
    }
  ],
  "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.3,
      "cvss_v3_severity": "High",
      "scenario": "AV:L - The vulnerable code is reached only through local sysfs attributes under /sys/class/sas_phy/ (phy error counters, enable, link rate) and the bsg device; there is no network-facing path into mpi3mr config-page processing.\nAC:L - The attacker controls both sides of the race by concurrently reading the world-readable phy error-counter attributes across multiple phys/threads, each of which memsets and reuses the shared mrioc->cfg_page outside cfg_cmds.mutex; the commit itself notes the corruption occurs on operations \"in rapid succession\", with no attacker-uncontrollable precondition.\nPR:L - The SAS transport exports invalid_dword_count, running_disparity_error_count, loss_of_dword_sync_count and phy_reset_problem_count with S_IRUGO (0444), and reading them invokes mpi3mr_transport_get_linkerrors() -> mpi3mr_cfg_get_sas_phy_pg1() -> mpi3mr_process_cfg_req(), so an unprivileged local user can drive the racy shared-buffer path and corrupt config requests issued by any other context, including a privileged WRITE_PERSISTENT.\nUI:N - The attacker's own concurrent sysfs reads race each other and race the driver's internal discovery/reset config-page reads; no victim action is required to trigger the corruption.\nS:U - The corrupted state is the HBA driver's DMA buffer and the controller configuration it manages, all within the kernel's own security authority; no VM, IOMMU, or sandbox boundary is crossed.\nC:L - A thread's post-mutex read-out memcpy can return a different config page's contents (device SAS addresses/WWNs, enclosure identifiers, expander topology, driver page settings), which are then surfaced to unprivileged userspace through the world-readable phy sysfs attributes; the leak is bounded to the 1024-byte shared config buffer rather than arbitrary kernel memory.\nI:H - mpi3mr_cfg_set_sas_io_unit_pg1() performs WRITE_CURRENT and WRITE_PERSISTENT with a payload staged in the unlocked shared buffer, so a racing reader causes zeroed/foreign data to be DMA'd into the controller's non-volatile SAS IO Unit / SAS Expander configuration, and garbled reads poison the driver's SAS topology state (device handles, SAS addresses, port IDs) used for I/O routing \u2014 a direct and serious integrity loss.\nA:H - A corrupted persistent SAS IO Unit Page 1 leaves PHYs disabled or with invalid link rates, so storage behind the HBA fails to come back and the misconfiguration survives reboot; additionally a botched config request drives mpi3mr_check_rh_fault_ioc(MPI3MR_RESET_FROM_CFG_REQ_TIMEOUT), diag-faulting and resetting the controller and potentially marking it unrecoverable, stalling all attached I/O."
    }
  }
}
