{
  "id": "CVE-2025-38257",
  "url": "https://poc.griffinguard.io/cve/CVE-2025-38257",
  "published_at": "2025-07-09T10:42:34.395Z",
  "title": "s390/pkey: Prevent overflow in size calculation for memdup_user()",
  "vendor": "Linux",
  "product": "Linux",
  "cvss": {
    "score": 7.8,
    "source": "nvd",
    "vector": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  },
  "kev": {
    "in_kev": false,
    "added_at": null,
    "days_after_publication": null
  },
  "first_poc": null,
  "poc_repo_count": 0,
  "exploit_count": 0,
  "suspicious_repo_count": 0,
  "edge_device": null,
  "description": "In the Linux kernel, the following vulnerability has been resolved:\n\ns390/pkey: Prevent overflow in size calculation for memdup_user()\n\nNumber of apqn target list entries contained in 'nr_apqns' variable is\ndetermined by userspace via an ioctl call so the result of the product in\ncalculation of size passed to memdup_user() may overflow.\n\nIn this case the actual size of the allocated area and the value\ndescribing it won't be in sync leading to various types of unpredictable\nbehaviour later.\n\nUse a proper memdup_array_user() helper which returns an error if an\noverflow is detected. Note that it is different from when nr_apqns is\ninitially zero - that case is considered valid and should be handled in\nsubsequent pkey_handler implementations.\n\nFound by Linux Verification Center (linuxtesting.org).",
  "cpes": [
    "cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.16:rc1:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.16:rc2:*:*:*:*:*:*",
    "cpe:2.3:o:linux:linux_kernel:6.16:rc3:*:*:*:*:*:*"
  ],
  "cvss_by_source": {
    "cna": 7.3,
    "nvd": 7.8
  },
  "repos": [],
  "remediation": {
    "affected": [
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "\u003e= f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d, \u003c ad1bdd24a02d5a8d119af8e4cd50933780a6d29f",
          "\u003e= f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d, \u003c faa1ab4a23c42e34dc000ef4977b751d94d5148c",
          "\u003e= f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d, \u003c 88f3869649edbc4a13f6c2877091f81cd5a50f05",
          "\u003e= f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d, \u003c f855b119e62b004a5044ed565f2a2b368c4d3f16",
          "\u003e= f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d, \u003c 73483ca7e07a5e39bdf612eec9d3d293e8bef649",
          "\u003e= f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d, \u003c 7360ee47599af91a1d5f4e74d635d9408a54e489"
        ],
        "fixed_in": [
          "ad1bdd24a02d5a8d119af8e4cd50933780a6d29f",
          "faa1ab4a23c42e34dc000ef4977b751d94d5148c",
          "88f3869649edbc4a13f6c2877091f81cd5a50f05",
          "f855b119e62b004a5044ed565f2a2b368c4d3f16",
          "73483ca7e07a5e39bdf612eec9d3d293e8bef649",
          "7360ee47599af91a1d5f4e74d635d9408a54e489"
        ]
      },
      {
        "vendor": "Linux",
        "product": "Linux",
        "ranges": [
          "5.4"
        ],
        "fixed_in": [
          "0",
          "5.15.187",
          "6.1.143",
          "6.6.96",
          "6.12.36",
          "6.15.5",
          "6.16"
        ]
      }
    ],
    "upgrade": [
      "Upgrade Linux to ad1bdd24a02d5a8d119af8e4cd50933780a6d29f or faa1ab4a23c42e34dc000ef4977b751d94d5148c or 88f3869649edbc4a13f6c2877091f81cd5a50f05 or f855b119e62b004a5044ed565f2a2b368c4d3f16 or 73483ca7e07a5e39bdf612eec9d3d293e8bef649 or 7360ee47599af91a1d5f4e74d635d9408a54e489 or later.",
      "Upgrade Linux to 0 or 5.15.187 or 6.1.143 or 6.6.96 or 6.12.36 or 6.15.5 or 6.16 or later."
    ]
  },
  "exploit_refs": [],
  "hunt_profile": [],
  "rules": []
}
