{"schemaVersion":1,"url":"https://cve.openhack.com/cve/CVE-2025-38257","id":"CVE-2025-38257","title":"s390/pkey: Prevent overflow in size calculation for memdup_user()","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 v","descriptionLong":"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).","published":"2025-07-09T10:42:34.395Z","updated":"2026-10-28T02:30:40.818700468Z","reserved":"2025-04-16T04:51:23.997Z","status":"Modified","rejected":false,"assigner":"Linux","metric":{"version":"3.1","score":7.3,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H","rating":"high","source":"Linux"},"metrics":[{"version":"3.1","score":7.3,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H","rating":"high","source":"Linux"},{"version":"3.1","score":7.3,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H","rating":"high","source":"416baaa9-dc9f-4396-8d5f-8c081fb06d67"},{"version":"3.1","score":7.8,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","rating":"high","source":"NVD"},{"version":"3.1","score":7.3,"vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H","rating":"high","source":"OSV"}],"rating":"high","products":["Linux"],"affectedProducts":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d","lessThan":"ad1bdd24a02d5a8d119af8e4cd50933780a6d29f","status":"affected","versionType":"git"},{"version":"f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d","lessThan":"faa1ab4a23c42e34dc000ef4977b751d94d5148c","status":"affected","versionType":"git"},{"version":"f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d","lessThan":"88f3869649edbc4a13f6c2877091f81cd5a50f05","status":"affected","versionType":"git"},{"version":"f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d","lessThan":"f855b119e62b004a5044ed565f2a2b368c4d3f16","status":"affected","versionType":"git"},{"version":"f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d","lessThan":"73483ca7e07a5e39bdf612eec9d3d293e8bef649","status":"affected","versionType":"git"},{"version":"f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d","lessThan":"7360ee47599af91a1d5f4e74d635d9408a54e489","status":"affected","versionType":"git"}],"platforms":[]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"5.4","status":"affected"},{"version":"0","lessThan":"5.4","status":"unaffected","versionType":"semver"},{"version":"5.15.187","lessThanOrEqual":"5.15.*","status":"unaffected","versionType":"semver"},{"version":"6.1.143","lessThanOrEqual":"6.1.*","status":"unaffected","versionType":"semver"},{"version":"6.6.96","lessThanOrEqual":"6.6.*","status":"unaffected","versionType":"semver"},{"version":"6.12.36","lessThanOrEqual":"6.12.*","status":"unaffected","versionType":"semver"},{"version":"6.15.5","lessThanOrEqual":"6.15.*","status":"unaffected","versionType":"semver"},{"version":"6.16","lessThanOrEqual":"*","status":"unaffected","versionType":"original_commit_for_fix"}],"platforms":[]}],"packages":[],"cwes":[],"aliases":[],"references":[{"url":"https://git.kernel.org/stable/c/ad1bdd24a02d5a8d119af8e4cd50933780a6d29f","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/faa1ab4a23c42e34dc000ef4977b751d94d5148c","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/88f3869649edbc4a13f6c2877091f81cd5a50f05","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/f855b119e62b004a5044ed565f2a2b368c4d3f16","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/73483ca7e07a5e39bdf612eec9d3d293e8bef649","tags":["Patch","web"]},{"url":"https://git.kernel.org/stable/c/7360ee47599af91a1d5f4e74d635d9408a54e489","tags":["Patch","web"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","tags":["Mailing List","Third Party Advisory","web"]},{"url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38257.json","tags":["advisory"]},{"url":"https://nvd.nist.gov/vuln/detail/CVE-2025-38257","tags":["advisory"]},{"url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","tags":["package"]}],"patchReferenced":true,"fixAvailable":true,"exploitReferenced":false,"kev":false,"kevAdded":null,"kevDue":null,"kevEntry":null,"ssvc":{"exploitation":"none","automatable":"no","technicalImpact":"partial"},"epss":0.00182,"epssPercentile":0.07923,"sources":[{"name":"CVE List","url":"https://www.cve.org/CVERecord?id=CVE-2025-38257","ok":true},{"name":"NVD","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-38257","ok":true,"note":"Modified"},{"name":"OSV","url":"https://osv.dev/vulnerability/CVE-2025-38257","ok":true,"note":"0 packages"},{"name":"CISA KEV","url":"https://www.cisa.gov/known-exploited-vulnerabilities-catalog","ok":true,"note":"not listed"},{"name":"EPSS","url":"https://api.first.org/data/v1/epss?cve=CVE-2025-38257","ok":true,"note":"scored 2026-11-19"}],"aiTitle":false,"tech":[],"critical":[],"attention":null}