# CVE-2025-38257: s390/pkey: Prevent overflow in size calculation for memdup_user()

- Severity: High 7.3 (CVSS:3.1, scored by Linux) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H`
- Known to be exploited: not in CISA's catalogue, which lists only what CISA has confirmed
- Likelihood of exploitation in the next 30 days (EPSS): 0.19%, higher than 8% of CVEs (2026-12-01)
- Published: 2025-07-09T10:42:34.395Z
- Modified: 2026-10-15T22:18:37.177Z
- SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial
- Assigned by: Linux

## Description

In the Linux kernel, the following vulnerability has been resolved:

s390/pkey: Prevent overflow in size calculation for memdup_user()

Number of apqn target list entries contained in 'nr_apqns' variable is
determined by userspace via an ioctl call so the result of the product in
calculation of size passed to memdup_user() may overflow.

In this case the actual size of the allocated area and the value
describing it won't be in sync leading to various types of unpredictable
behaviour later.

Use a proper memdup_array_user() helper which returns an error if an
overflow is detected. Note that it is different from when nr_apqns is
initially zero - that case is considered valid and should be handled in
subsequent pkey_handler implementations.

Found by Linux Verification Center (linuxtesting.org).

(As written by CVE List.)

## Affected

- Linux Linux: from f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d before ad1bdd24a02d5a8d119af8e4cd50933780a6d29f; from f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d before faa1ab4a23c42e34dc000ef4977b751d94d5148c; from f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d before 88f3869649edbc4a13f6c2877091f81cd5a50f05; from f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d before f855b119e62b004a5044ed565f2a2b368c4d3f16; from f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d before 73483ca7e07a5e39bdf612eec9d3d293e8bef649; from f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d before 7360ee47599af91a1d5f4e74d635d9408a54e489; 5.4 (not affected: before 5.4; from 5.15.187 up to 5.15.*; from 6.1.143 up to 6.1.*; from 6.6.96 up to 6.6.*; from 6.12.36 up to 6.12.*; from 6.15.5 up to 6.15.*; from 6.16 up to *)
- linux linux_kernel: from 5.4 before 5.15.187; from 5.16 before 6.1.143; from 6.2 before 6.6.96; from 6.7 before 6.12.36; from 6.13 before 6.15.5; 6.16
- debian debian_linux: 11.0

## Every score

- Linux: CVSS:3.1 7.3 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H`
- NVD: CVSS:3.1 7.8 High `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`

## References

- <https://git.kernel.org/stable/c/ad1bdd24a02d5a8d119af8e4cd50933780a6d29f> (patch)
- <https://git.kernel.org/stable/c/faa1ab4a23c42e34dc000ef4977b751d94d5148c> (patch)
- <https://git.kernel.org/stable/c/88f3869649edbc4a13f6c2877091f81cd5a50f05> (patch)
- <https://git.kernel.org/stable/c/f855b119e62b004a5044ed565f2a2b368c4d3f16> (patch)
- <https://git.kernel.org/stable/c/73483ca7e07a5e39bdf612eec9d3d293e8bef649> (patch)
- <https://git.kernel.org/stable/c/7360ee47599af91a1d5f4e74d635d9408a54e489> (patch)
- <https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html> (mailing-list, third-party-advisory)

## Sources

- CVE List: [CVE-2025-38257](https://www.cve.org/CVERecord?id=CVE-2025-38257), CVE Terms of Use, modified 2026-10-15
- NVD: [CVE-2025-38257](https://nvd.nist.gov/vuln/detail/CVE-2025-38257), Public domain, modified 2026-10-15

---

Page: https://cve.day/CVE-2025-38257 · Whole record: https://cve.day/CVE-2025-38257.json · Rebuilt by cve.day 2026-11-25T22:59:01.015Z
