CVE-2025-38257 s390/pkey: Prevent overflow in size calculation for memdup_user()
An integer overflow in the s390/pkey driver allows attackers to trigger memory corruption via a crafted ioctl call, potentially leading to code execution or system crashes.
- Exploited in the wild
- Not known
- Login needed
- Any signed-in user
- Attackable
- Local or same network only
- Victim action needed
- Not needed
- Fix
- Available
What is CVE-2025-38257?
CVE-2025-38257 is a high-severity vulnerability in Debian Debian Linux, published on 9 Jul 2025. It can only be exploited from the same machine or local network, with no action from the victim.
Official 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).
Which versions are affected by CVE-2025-38257?
It affects 2 products.
Products include Debian Debian Linux, Linux kernel.
How do I fix CVE-2025-38257?
Apply the vendor's patch.
Is CVE-2025-38257 being exploited?
There is no known exploitation of CVE-2025-38257 in the wild and no public exploit code.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as AZL-64871, BELL-CVE-2025-38257, DEBIAN-CVE-2025-38257, GHSA-wgwx-65v3-j243, ROOT-OS-DEBIAN-11-CVE-2025-38257, ROOT-OS-DEBIAN-12-CVE-2025-38257 and 3 more.