{"id":"CVE-2025-40201","summary":"kernel/sys.c: fix the racy usage of task_lock(tsk-\u003egroup_leader) in sys_prlimit64() paths","details":"In the Linux kernel, the following vulnerability has been resolved:\n\nkernel/sys.c: fix the racy usage of task_lock(tsk-\u003egroup_leader) in sys_prlimit64() paths\n\nThe usage of task_lock(tsk-\u003egroup_leader) in sys_prlimit64()-\u003edo_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-\u003egroup_leader) may use the already freed task_struct.\n\nAnother problem is that sys_prlimit64() can race with mt-exec which changes\n-\u003egroup_leader. In this case do_prlimit() may take the wrong lock, or (worse)\n-\u003egroup_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.","modified":"2026-04-02T12:48:19.413396Z","published":"2025-11-12T21:56:34.063Z","related":["SUSE-SU-2026:0962-1","SUSE-SU-2026:1081-1","SUSE-SU-2026:20012-1","SUSE-SU-2026:20015-1","SUSE-SU-2026:20021-1","openSUSE-SU-2025:20172-1"],"database_specific":{"osv_generated_from":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40201.json","cna_assigner":"Linux"},"references":[{"type":"WEB","url":"https://git.kernel.org/stable/c/132f827e7bac7373e1522e89709d70b43cae5342"},{"type":"WEB","url":"https://git.kernel.org/stable/c/19b45c84bd9fd42fa97ff80c6350d604cb871c75"},{"type":"WEB","url":"https://git.kernel.org/stable/c/1bc0d9315ef5296abb2c9fd840336255850ded18"},{"type":"WEB","url":"https://git.kernel.org/stable/c/6796412decd2d8de8ec708213bbc958fab72f143"},{"type":"WEB","url":"https://git.kernel.org/stable/c/a15f37a40145c986cdf289a4b88390f35efdecc4"},{"type":"ADVISORY","url":"https://github.com/CVEProject/cvelistV5/tree/main/cves/2025/40xxx/CVE-2025-40201.json"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-40201"},{"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":"18c91bb2d87268d23868bf13508f5bc9cf04e89a"},{"fixed":"1bc0d9315ef5296abb2c9fd840336255850ded18"},{"fixed":"132f827e7bac7373e1522e89709d70b43cae5342"},{"fixed":"19b45c84bd9fd42fa97ff80c6350d604cb871c75"},{"fixed":"6796412decd2d8de8ec708213bbc958fab72f143"},{"fixed":"a15f37a40145c986cdf289a4b88390f35efdecc4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-40201.json"}},{"package":{"name":"Kernel","ecosystem":"Linux"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"5.18.0"},{"fixed":"6.1.157"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.2.0"},{"fixed":"6.6.113"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.7.0"},{"fixed":"6.12.54"}]},{"type":"ECOSYSTEM","events":[{"introduced":"6.13.0"},{"fixed":"6.17.4"}]}],"database_specific":{"source":"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2025-40201.json"}}],"schema_version":"1.7.5"}