{"id":"CVE-2025-38445","aliases":["CVE-2025-38445"],"related":[],"kind":"vulnerability","state":"published","title":"md/raid1: Fix stack memory use after return in raid1_reshape","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmd/raid1: Fix stack memory use after return in raid1_reshape\n\nIn the raid1_reshape function, newpool is\nallocated on the stack and assigned to conf->r1bio_pool.\nThis results in conf->r1bio_pool.wait.head pointing\nto a stack address.\nAccessing this address later can lead to a kernel panic.\n\nExample access path:\n\nraid1_reshape()\n{\n\t// newpool is on the stack\n\tmempool_t newpool, oldpool;\n\t// initialize newpool.wait.head to stack address\n\tmempool_init(&newpool, ...);\n\tconf->r1bio_pool = newpool;\n}\n\nraid1_read_request() or raid1_write_request()\n{\n\talloc_r1bio()\n\t{\n\t\tmempool_alloc()\n\t\t{\n\t\t\t// if pool->alloc fails\n\t\t\tremove_element()\n\t\t\t{\n\t\t\t\t--pool->curr_nr;\n\t\t\t}\n\t\t}\n\t}\n}\n\nmempool_free()\n{\n\tif (pool->curr_nr < pool->min_nr) {\n\t\t// pool->wait.head is a stack address\n\t\t// wake_up() will try to access this invalid address\n\t\t// which leads to a kernel panic\n\t\treturn;\n\t\twake_up(&pool->wait);\n\t}\n}\n\nFix:\nreinit conf->r1bio_pool.wait after assigning newpool.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmd/raid1: Fix stack memory use after return in raid1_reshape\n\nIn the raid1_reshape function, newpool is\nallocated on the stack and assigned to conf->r1bio_pool.\nThis results in conf->r1bio_pool.wait.head pointing\nto a stack address.\nAccessing this address later can lead to a kernel panic.\n\nExample access path:\n\nraid1_reshape()\n{\n\t// newpool is on the stack\n\tmempool_t newpool, oldpool;\n\t// initialize newpool.wait.head to stack address\n\tmempool_init(&newpool, ...);\n\tconf->r1bio_pool = newpool;\n}\n\nraid1_read_request() or raid1_write_request()\n{\n\talloc_r1bio()\n\t{\n\t\tmempool_alloc()\n\t\t{\n\t\t\t// if pool->alloc fails\n\t\t\tremove_element()\n\t\t\t{\n\t\t\t\t--pool->curr_nr;\n\t\t\t}\n\t\t}\n\t}\n}\n\nmempool_free()\n{\n\tif (pool->curr_nr < pool->min_nr) {\n\t\t// pool->wait.head is a stack address\n\t\t// wake_up() will try to access this invalid address\n\t\t// which leads to a kernel panic\n\t\treturn;\n\t\twake_up(&pool->wait);\n\t}\n}\n\nFix:\nreinit conf->r1bio_pool.wait after assigning newpool.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: md/raid1: Corregir el uso de memoria de la pila después del retorno en raid1_reshape En la función raid1_reshape, newpool se asigna en la pila y a conf-&gt;r1bio_pool. Esto da como resultado que conf-&gt;r1bio_pool.wait.head apunte a una dirección de pila. Acceder a esta dirección más tarde puede provocar un pánico del kernel. Ejemplo de ruta de acceso: raid1_reshape() { // newpool está en la pila mempool_t newpool, oldpool; // inicializar newpool.wait.head en la dirección de la pila mempool_init(&amp;newpool, ...); conf-&gt;r1bio_pool = newpool; } raid1_read_request() o raid1_write_request() { alloc_r1bio() { mempool_alloc() { // si pool-&gt;alloc falla remove_element() { --pool-&gt;curr_nr; } } } } mempool_free() { if (pool-&gt;curr_nr &lt; pool-&gt;min_nr) { // pool-&gt;wait.head es una dirección de pila // wake_up() intentará acceder a esta dirección no válida // lo que genera un pánico del kernel return; wake_up(&amp;pool-&gt;wait); } } Solución: reinicie conf-&gt;r1bio_pool.wait después de asignar newpool.","source":"nvd"}],"published":"2025-07-25T15:27:28.035Z","modified":"2026-11-05T21:18:32.113Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":7.1,"rating":"HIGH"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:N/A:H","score":7.1,"rating":"HIGH"}],"cwes":["CWE-125"],"affected":[{"ranges":[{"type":"git","introduced":"afeee514ce7f4cab605beedd03be71ebaf0c5fc8","fixed":"d8a6853d00fbaa810765c8ed2f452a5832273968","status":"affected"},{"type":"git","introduced":"afeee514ce7f4cab605beedd03be71ebaf0c5fc8","fixed":"12b00ec99624f8da8c325f2dd6e807df26df0025","status":"affected"},{"type":"git","introduced":"afeee514ce7f4cab605beedd03be71ebaf0c5fc8","fixed":"48da050b4f54ed639b66278d0ae6f4107b2c4e2d","status":"affected"},{"type":"git","introduced":"afeee514ce7f4cab605beedd03be71ebaf0c5fc8","fixed":"5f35e48b76655e45522df338876dfef88dafcc71","status":"affected"},{"type":"git","introduced":"afeee514ce7f4cab605beedd03be71ebaf0c5fc8","fixed":"df5894014a92ff0196dbc212a7764e97366fd2b7","status":"affected"},{"type":"git","introduced":"afeee514ce7f4cab605beedd03be71ebaf0c5fc8","fixed":"776e6186dc9ecbdb8a1b706e989166c8a99bbf64","status":"affected"},{"type":"git","introduced":"afeee514ce7f4cab605beedd03be71ebaf0c5fc8","fixed":"61fd5e93006cf82ec8ee5c115ab5cf4bbd104bdb","status":"affected"},{"type":"git","introduced":"afeee514ce7f4cab605beedd03be71ebaf0c5fc8","fixed":"d67ed2ccd2d1dcfda9292c0ea8697a9d0f2f0d98","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"4.18","status":"affected"},{"type":"semver","introduced":"0","fixed":"4.18","status":"unaffected"},{"type":"semver","introduced":"5.4.296","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.240","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.189","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.146","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.99","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.39","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.15.7","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":"4.18","fixed":"5.4.296"},{"status":"affected","introduced":"5.5","fixed":"5.10.240"},{"status":"affected","introduced":"5.11","fixed":"5.15.189"},{"status":"affected","introduced":"5.16","fixed":"6.1.146"},{"status":"affected","introduced":"6.2","fixed":"6.6.99"},{"status":"affected","introduced":"6.7","fixed":"6.12.39"},{"status":"affected","introduced":"6.13","fixed":"6.15.7"},{"status":"affected","version":"6.16"},{"status":"affected","version":"6.16"},{"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/d8a6853d00fbaa810765c8ed2f452a5832273968","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/12b00ec99624f8da8c325f2dd6e807df26df0025","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/48da050b4f54ed639b66278d0ae6f4107b2c4e2d","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5f35e48b76655e45522df338876dfef88dafcc71","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/df5894014a92ff0196dbc212a7764e97366fd2b7","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/776e6186dc9ecbdb8a1b706e989166c8a99bbf64","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/61fd5e93006cf82ec8ee5c115ab5cf4bbd104bdb","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/d67ed2ccd2d1dcfda9292c0ea8697a9d0f2f0d98","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00008.html","tags":["third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html","tags":["third-party-advisory"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2026-11-05T20:56:58.658Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-38445","url":"https://www.cve.org/CVERecord?id=CVE-2025-38445","licence":"CVE Terms of Use","modified":"2026-11-05T21:02:38.838Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-38445","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-38445","licence":"Public domain","modified":"2026-11-05T21:18:32.113Z"}],"updatedAt":"2026-11-25T22:59:01.720Z","epss":{"score":0.00218,"percentile":0.13105,"date":"2026-12-01T12:00:22.000Z"}}