{"id":"CVE-2025-38257","summary":"s390/pkey: Prevent overflow in size calculation for memdup_user()","details":"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).","modified":"2026-04-16T04:30:34.754926628Z","published":"2025-07-09T10:42:34.395Z","related":["SUSE-SU-2025:02588-1","SUSE-SU-2025:02848-1","SUSE-SU-2025:02849-1","SUSE-SU-2025:02850-1","SUSE-SU-2025:02851-1","SUSE-SU-2025:02852-1","SUSE-SU-2025:02853-1","SUSE-SU-2025:02923-1","SUSE-SU-2025:02969-1","SUSE-SU-2025:02996-1","SUSE-SU-2025:02997-1","SUSE-SU-2025:03011-1","SUSE-SU-2025:03023-1","SUSE-SU-2025:20577-1","SUSE-SU-2025:20586-1","SUSE-SU-2025:20601-1","SUSE-SU-2025:20602-1","SUSE-SU-2025:21074-1","SUSE-SU-2025:21139-1","SUSE-SU-2025:21179-1","SUSE-SU-2026:0090-1","openSUSE-SU-2025:20081-1"],"database_specific":{"cna_assigner":"Linux","osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38257.json"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/73483ca7e07a5e39bdf612eec9d3d293e8bef649"},{"type":"WEB","url":"https://git.kernel.org/stable/c/7360ee47599af91a1d5f4e74d635d9408a54e489"},{"type":"WEB","url":"https://git.kernel.org/stable/c/88f3869649edbc4a13f6c2877091f81cd5a50f05"},{"type":"WEB","url":"https://git.kernel.org/stable/c/ad1bdd24a02d5a8d119af8e4cd50933780a6d29f"},{"type":"WEB","url":"https://git.kernel.org/stable/c/f855b119e62b004a5044ed565f2a2b368c4d3f16"},{"type":"WEB","url":"https://git.kernel.org/stable/c/faa1ab4a23c42e34dc000ef4977b751d94d5148c"},{"type":"WEB","url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/38xxx/CVE-2025-38257.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-38257"},{"type":"PACKAGE","url":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git"}],"affected":[{"ranges":[{"type":"GIT","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","events":[{"introduced":"f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d"},{"fixed":"ad1bdd24a02d5a8d119af8e4cd50933780a6d29f"},{"fixed":"faa1ab4a23c42e34dc000ef4977b751d94d5148c"},{"fixed":"88f3869649edbc4a13f6c2877091f81cd5a50f05"},{"fixed":"f855b119e62b004a5044ed565f2a2b368c4d3f16"},{"fixed":"73483ca7e07a5e39bdf612eec9d3d293e8bef649"},{"fixed":"7360ee47599af91a1d5f4e74d635d9408a54e489"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-38257.json"}}],"schema_version":"1.7.5"}