CVE-2025-38257

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

7.3 high EPSS 0.19%

Published 9 Jul 2025 Updated 15 Oct 2026 CNA: Linux

Check your servers for CVE-2025-38257

The Vulnpocalypse collector sends the package list of each Linux server and of its container images once a day. Vulnpocalypse shows every server where CVE-2025-38257 affects the running kernel, with the command that installs the fix. The free plan covers one server and one domain and does not need a credit card.

Check my servers

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).

Severity (CVSS)

7.3 high CVSS 3.1 from Linux (CNA)
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H
Attack vector
local: the attacker needs local access, or a user has to open a prepared file
Attack complexity
low: an attack works without special conditions
Privileges required
low: the attacker needs an ordinary user account
User interaction
none: nobody has to click or open anything
Scope
unchanged: the damage stays inside the vulnerable component
Impact
confidentiality high, integrity low, availability high: what an attacker can read (confidentiality), change (integrity) or stop (availability)

Exploitation

EPSS 0.19%: the probability of exploitation activity in the next 30 days, from the EPSS model of FIRST. The score is higher than 8.97% of all scored CVEs. Scores of 1 Dec 2026.

The assessment of CISA (SSVC, 15 Oct 2026):

Exploitation
none: CISA did not find evidence of exploitation or a public proof of concept
Automatable
no: each attack takes manual steps
Technical impact
partial: limited control or limited data

Affected products

As the CNA lists them.

ProductVersions
Linux
affected from f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d, before ad1bdd24a02d5a8d119af8e4cd50933780a6d29f
affected from f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d, before faa1ab4a23c42e34dc000ef4977b751d94d5148c
affected from f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d, before 88f3869649edbc4a13f6c2877091f81cd5a50f05
affected from f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d, before f855b119e62b004a5044ed565f2a2b368c4d3f16
affected from f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d, before 73483ca7e07a5e39bdf612eec9d3d293e8bef649
affected from f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d, before 7360ee47599af91a1d5f4e74d635d9408a54e489
Other versions: unaffected
Linux
affected 5.4
unaffected before 5.4
unaffected from 5.15.187 up to and including 5.15.*
unaffected from 6.1.143 up to and including 6.1.*
unaffected from 6.6.96 up to and including 6.6.*
unaffected from 6.12.36 up to and including 6.12.*
unaffected from 6.15.5 up to and including 6.15.*
unaffected 6.16 and later
Other versions: affected

Is my server affected?

This CVE is in the Linux kernel. Compare the running kernel with the fixed kernel version of your distribution, and reboot after a kernel update:

uname -r
# Debian, Ubuntu: does the changelog of the running kernel name the CVE?
zgrep -l CVE-2025-38257 /usr/share/doc/linux-image-$(uname -r)/changelog.Debian.gz
# RHEL, Rocky, Alma
rpm -q --changelog kernel | grep CVE-2025-38257

With Trivy, on the host and for a container image. When a package is affected, it prints the installed and the fixed version:

trivy rootfs --scanners vuln / | grep CVE-2025-38257
trivy image --scanners vuln IMAGE | grep CVE-2025-38257

Vulnpocalypse makes this comparison every day for the package lists of your servers and container images, including language packages (npm, PyPI, Go, Maven and others), and sends the command that installs the fix. Start free with one server and one domain or read how to install the collector.

References

Other references

Source: the record CVE-2025-38257 of the CVE List (CVE Program), CVE Terms of Use; the CISA KEV catalog and the CISA ADP container; EPSS of FIRST. The text of the record is shown as published. Data sources and licences.