{"id":"CVE-2025-40201","aliases":["CVE-2025-40201"],"related":[],"kind":"vulnerability","state":"published","title":"kernel/sys.c: fix the racy usage of task_lock(tsk->group_leader) in sys_prlimit64() paths","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nkernel/sys.c: fix the racy usage of task_lock(tsk->group_leader) in sys_prlimit64() paths\n\nThe usage of task_lock(tsk->group_leader) in sys_prlimit64()->do_prlimit()\npath is very broken.\n\nsys_prlimit64() does get_task_struct(tsk) but this only protects task_struct\nitself. If tsk != current and tsk is not a leader, this process can exit/exec\nand task_lock(tsk->group_leader) may use the already freed task_struct.\n\nAnother problem is that sys_prlimit64() can race with mt-exec which changes\n->group_leader. In this case do_prlimit() may take the wrong lock, or (worse)\n->group_leader may change between task_lock() and task_unlock().\n\nChange sys_prlimit64() to take tasklist_lock when necessary. This is not\nnice, but I don't see a better fix for -stable.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nkernel/sys.c: fix the racy usage of task_lock(tsk->group_leader) in sys_prlimit64() paths\n\nThe usage of task_lock(tsk->group_leader) in sys_prlimit64()->do_prlimit()\npath is very broken.\n\nsys_prlimit64() does get_task_struct(tsk) but this only protects task_struct\nitself. If tsk != current and tsk is not a leader, this process can exit/exec\nand task_lock(tsk->group_leader) may use the already freed task_struct.\n\nAnother problem is that sys_prlimit64() can race with mt-exec which changes\n->group_leader. In this case do_prlimit() may take the wrong lock, or (worse)\n->group_leader may change between task_lock() and task_unlock().\n\nChange sys_prlimit64() to take tasklist_lock when necessary. This is not\nnice, but I don't see a better fix for -stable.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nkernel/sys.c: corregir el uso propenso a condiciones de carrera de task_lock(tsk->group_leader) en las rutas de sys_prlimit64()\n\nEl uso de task_lock(tsk->group_leader) en la ruta sys_prlimit64()->do_prlimit() está muy defectuoso.\n\nsys_prlimit64() realiza get_task_struct(tsk) pero esto solo protege la propia task_struct. Si tsk != current y tsk no es un líder, este proceso puede salir/ejecutar y task_lock(tsk->group_leader) puede usar la task_struct ya liberada.\n\nOtro problema es que sys_prlimit64() puede entrar en condición de carrera con mt-exec, que cambia ->group_leader. En este caso, do_prlimit() puede tomar el bloqueo incorrecto, o (peor aún) ->group_leader puede cambiar entre task_lock() y task_unlock().\n\nModificar sys_prlimit64() para tomar tasklist_lock cuando sea necesario. Esto no es ideal, pero no veo una mejor solución para -stable.","source":"nvd"}],"published":"2025-11-12T21:56:34.063Z","modified":"2026-10-19T21:10:00.160Z","severity":{"scorer":"Linux","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"},"severities":[{"scorer":"Linux","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":"18c91bb2d87268d23868bf13508f5bc9cf04e89a","fixed":"1bc0d9315ef5296abb2c9fd840336255850ded18","status":"affected"},{"type":"git","introduced":"18c91bb2d87268d23868bf13508f5bc9cf04e89a","fixed":"132f827e7bac7373e1522e89709d70b43cae5342","status":"affected"},{"type":"git","introduced":"18c91bb2d87268d23868bf13508f5bc9cf04e89a","fixed":"19b45c84bd9fd42fa97ff80c6350d604cb871c75","status":"affected"},{"type":"git","introduced":"18c91bb2d87268d23868bf13508f5bc9cf04e89a","fixed":"6796412decd2d8de8ec708213bbc958fab72f143","status":"affected"},{"type":"git","introduced":"18c91bb2d87268d23868bf13508f5bc9cf04e89a","fixed":"a15f37a40145c986cdf289a4b88390f35efdecc4","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"5.18","status":"affected"},{"type":"semver","introduced":"0","fixed":"5.18","status":"unaffected"},{"type":"semver","introduced":"6.1.157","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.113","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.54","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.17.4","lastAffected":"6.17.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.18","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/1bc0d9315ef5296abb2c9fd840336255850ded18","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/132f827e7bac7373e1522e89709d70b43cae5342","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/19b45c84bd9fd42fa97ff80c6350d604cb871c75","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/6796412decd2d8de8ec708213bbc958fab72f143","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/a15f37a40145c986cdf289a4b88390f35efdecc4","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"total","date":"2026-10-15T21:58:02.275Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-40201","url":"https://www.cve.org/CVERecord?id=CVE-2025-40201","licence":"CVE Terms of Use","modified":"2026-10-15T22:02:40.564Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-40201","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-40201","licence":"Public domain","modified":"2026-10-19T21:10:00.160Z"}],"updatedAt":"2026-11-25T22:59:07.600Z","epss":{"score":0.00157,"percentile":0.05148,"date":"2026-12-02T12:00:21.000Z"}}