{
  "schema_version": "1.6.1",
  "id": "RPI-CVE-2025-40253",
  "modified": "2026-10-09T11:39:44Z",
  "upstream": [
    "CVE-2025-40253"
  ],
  "published": "2025-12-04T16:09:50Z",
  "summary": "s390/ctcm: Fix double-kfree",
  "details": "In the Linux kernel, the following vulnerability has been resolved:\n\ns390/ctcm: Fix double-kfree\n\nThe function 'mpc_rcvd_sweep_req(mpcginfo)' is called conditionally\nfrom function 'ctcmpc_unpack_skb'. It frees passed mpcginfo.\nAfter that a call to function 'kfree' in function 'ctcmpc_unpack_skb'\nfrees it again.\n\nRemove 'kfree' call in function 'mpc_rcvd_sweep_req(mpcginfo)'.\n\nBug detected by the clang static analyzer.",
  "severity": [
    {
      "type": "CVSS_V3",
      "score": "CVSS:3.1/AV:A/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.159",
            "compiled_filter": false
          }
        }
      }
    }
  ],
  "references": [
    {
      "type": "ADVISORY",
      "url": "https://www.cve.org/CVERecord?id=CVE-2025-40253"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/06f1dd1de0d33dbfbd2e1fc9fc57d8895f730de2"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/6bf8ccaabce8cebb6cb1f255c93d0acdfe95c17a"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/7616e2eee679746d526c7f5befd4eedb995935b5"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/43096dab8cc60fc39133205fd149a54d3acebea8"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/3b177b2ded563df16f6d5920671ffcfe5915d472"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/b9dbfb1b5699f9f1e4991f96741bdf9047147589"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/7ff76f8dc6b550f8d16487bf3cebc278be720b5c"
    },
    {
      "type": "FIX",
      "url": "https://git.kernel.org/stable/c/da02a1824884d6c84c5e5b5ac373b0c9e3288ec2"
    }
  ],
  "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": 8.8,
      "cvss_v3_severity": "High",
      "scenario": "AV:A - The malicious `TH_SWEEP_REQ` transmission header is delivered as a link-level MPC frame by the directly-attached CTC peer (a partner LPAR or a z/VM guest coupled via virtual CTCA), reaching `ctcmpc_unpack_skb()` straight from the channel read interrupt. MPC TH headers are regenerated per link and not routable, so the attacker must sit on the adjacent channel connection rather than across a routed network.\nAC:L - A single frame with `th_ch_flag = 0xfe` deterministically drives `ctcmpc_unpack_skb()` into `mpc_rcvd_sweep_req()` and the two consecutive `kfree()` calls every time \u2014 no race, no timing window, and no memory-layout precondition outside the attacker's control.\nPR:N - The attacker needs no account, credential, or capability on the target Linux image; it only has to be the CTC peer, and the path is reachable both in `MPCG_STATE_READY` and during the pre-establishment XID-negotiation states, where no authentication of any kind has occurred.\nUI:N - The remote peer triggers the double free entirely on its own by transmitting one frame on an already-active CTC link; no administrator or user action on the victim system is needed at attack time.\nS:U - The slab corruption occurs in the receiving kernel's own softirq/tasklet context and its consequences stay within that kernel's security authority; no hypervisor, IOMMU, or sandbox boundary is crossed.\nC:H - On kernels without freelist hardening the double free leaves the kmalloc-64 percpu freelist self-referential, so repeated allocations hand the same 40-byte object to unrelated kernel structures, yielding an aliasing/use-after-free primitive that exposes arbitrary kernel memory contents to the attacker-controlled objects.\nI:H - The same freelist corruption lets attacker-influenced allocations overlap live kernel objects (type confusion), giving a write primitive over adjacent/aliased kernel data and a realistic path to control-flow hijack \u2014 classic exploitable heap corruption, not a mere accounting error.\nA:H - With `CONFIG_SLAB_FREELIST_HARDENED` the immediate double free hits `BUG_ON(object == fp)` in `set_freepointer()` inside a tasklet, which is fatal in interrupt context; without it the corrupted freelist causes near-certain crashes, and either outcome is re-triggerable at will by the peer."
    }
  }
}
