{"id":"CVE-2025-38257","aliases":["CVE-2025-38257"],"related":[],"kind":"vulnerability","state":"published","title":"s390/pkey: Prevent overflow in size calculation for memdup_user()","summary":"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).","summarySource":"cvelist","descriptions":[{"lang":"en","text":"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).","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: s390/pkey: Evitar el desbordamiento en el cálculo del tamaño para memdup_user() El número de entradas de la lista de destino apqn contenidas en la variable 'nr_apqns' está determinado por el espacio de usuario a través de una llamada ioctl, por lo que el resultado del producto en el cálculo del tamaño pasado a memdup_user() puede desbordarse. En este caso, el tamaño real del área asignada y el valor que lo describe no estarán sincronizados, lo que provocará varios tipos de comportamiento impredecible más adelante. Utilice un ayudante memdup_array_user() adecuado que devuelva un error si se detecta un desbordamiento. Tenga en cuenta que es diferente de cuando nr_apqns es inicialmente cero: ese caso se considera válido y debe manejarse en implementaciones posteriores de pkey_handler. Encontrado por el Centro de verificación de Linux (linuxtesting.org).","source":"nvd"}],"published":"2025-07-09T10:42:34.395Z","modified":"2026-10-15T22:18:37.177Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H","score":7.3,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:L/A:H","score":7.3,"rating":"HIGH"},{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d","fixed":"ad1bdd24a02d5a8d119af8e4cd50933780a6d29f","status":"affected"},{"type":"git","introduced":"f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d","fixed":"faa1ab4a23c42e34dc000ef4977b751d94d5148c","status":"affected"},{"type":"git","introduced":"f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d","fixed":"88f3869649edbc4a13f6c2877091f81cd5a50f05","status":"affected"},{"type":"git","introduced":"f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d","fixed":"f855b119e62b004a5044ed565f2a2b368c4d3f16","status":"affected"},{"type":"git","introduced":"f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d","fixed":"73483ca7e07a5e39bdf612eec9d3d293e8bef649","status":"affected"},{"type":"git","introduced":"f2bbc96e7cfad3891b7bf9bd3e566b9b7ab4553d","fixed":"7360ee47599af91a1d5f4e74d635d9408a54e489","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.4","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.4","status":"unaffected"},{"type":"semver","introduced":"5.15.187","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.143","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.96","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.36","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.15.5","lastAffected":"6.15.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.16","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"5.4","fixed":"5.15.187"},{"status":"affected","introduced":"5.16","fixed":"6.1.143"},{"status":"affected","introduced":"6.2","fixed":"6.6.96"},{"status":"affected","introduced":"6.7","fixed":"6.12.36"},{"status":"affected","introduced":"6.13","fixed":"6.15.5"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/ad1bdd24a02d5a8d119af8e4cd50933780a6d29f","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/faa1ab4a23c42e34dc000ef4977b751d94d5148c","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/88f3869649edbc4a13f6c2877091f81cd5a50f05","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/f855b119e62b004a5044ed565f2a2b368c4d3f16","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/73483ca7e07a5e39bdf612eec9d3d293e8bef649","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7360ee47599af91a1d5f4e74d635d9408a54e489","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","tags":["mailing-list","third-party-advisory"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-10-15T21:49:06.214Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-38257","url":"https://www.cve.org/CVERecord?id=CVE-2025-38257","licence":"CVE Terms of Use","modified":"2026-10-15T21:52:12.939Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-38257","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-38257","licence":"Public domain","modified":"2026-10-15T22:18:37.177Z"}],"updatedAt":"2026-11-25T22:59:01.015Z","epss":{"score":0.00189,"percentile":0.08968,"date":"2026-12-01T12:00:22.000Z"}}