CVE-2025-40201
kernel/sys.c: fix the racy usage of task_lock(tsk->group_leader) in sys_prlimit64() paths
Reported by linux · Published November 12, 2025
In the Linux kernel, the following vulnerability has been resolved: kernel/sys.c: fix the racy usage of task_lock(tsk->group_leader) in sys_prlimit64() paths The usage of task_lock(tsk->group_leader) in sys_prlimit64()->do_prlimit() path is very broken. sys_prlimit64() does get_task_struct(tsk) but this only protects task_struct itself. If tsk != current and tsk is not a leader, this process can exit/exec and task_lock(tsk->group_leader) may use the already freed task_struct. Another problem is that sys_prlimit64() can race with mt-exec which changes ->group_leader. In this case do_prlimit() may take the wrong lock, or (worse) ->group_leader may change between task_lock() and task_unlock(). Change sys_prlimit64() to take tasklist_lock when necessary. This is not nice, but I don't see a better fix for -stable.
Fixed versions
Upgrade to a fixed version or later. Language registries are listed first, then Linux distributions, then vendor products.
| Package | Ecosystem | Fixed in |
|---|---|---|
| python3-perf6.12 | Amazon Linux | 1:6.12.55-74.119.amzn2023 |
| kernel6.12-modules-extra | Amazon Linux | 1:6.12.55-74.119.amzn2023 |
| kernel-libbpf-devel | Amazon Linux | 1:6.1.158-178.288.amzn2023 |
| kernel6.12-devel | Amazon Linux | 1:6.12.55-74.119.amzn2023 |
| kernel | Amazon Linux | 1:6.1.158-178.288.amzn2023 |
| kernel-tools-devel | Amazon Linux | 1:6.1.158-178.288.amzn2023 |
| perf6.12 | Amazon Linux | 1:6.12.55-74.119.amzn2023 |
| kernel-modules-extra-common | Amazon Linux | 1:6.1.158-178.288.amzn2023 |
| kernel6.12-libbpf-devel | Amazon Linux | 1:6.12.55-74.119.amzn2023 |
| kernel6.12-libbpf | Amazon Linux | 1:6.12.55-74.119.amzn2023 |
| python3-perf | Amazon Linux | 1:6.1.158-178.288.amzn2023 |
| kernel6.12-libbpf-static | Amazon Linux | 1:6.12.55-74.119.amzn2023 |
4 more packages have a fixed version. See every fix in Lookup.
Risk scores
Affected products
| Vendor | Product | Versions |
|---|---|---|
| Linux | Linux | 18c91bb2d87268d23868bf13508f5bc9cf04e89a, 18c91bb2d87268d23868bf13508f5bc9cf04e89a, 18c91bb2d87268d23868bf13508f5bc9cf04e89a |
| Linux | Linux | 5.18, 0, 6.1.157 |
| amazon:2023 | python3-perf6.12 | 0 |
| amazon:2023 | kernel6.12-modules-extra | 0 |
| amazon:2023 | kernel-libbpf-devel | 0 |
| amazon:2023 | kernel6.12-devel | 0 |
| amazon:2023 | kernel | 0 |
| amazon:2023 | kernel-tools-devel | 0 |
| amazon:2023 | perf6.12 | 0 |
| amazon:2023 | kernel-modules-extra-common | 0 |
| amazon:2023 | kernel6.12-libbpf-devel | 0 |
| amazon:2023 | kernel6.12-libbpf | 0 |
| amazon:2023 | python3-perf | 0 |
| amazon:2023 | kernel6.12-libbpf-static | 0 |
| amazon:2023 | kernel6.12-headers | 0 |
| amazon:2023 | kernel-libbpf | 0 |
| amazon:2023 | kernel-tools | 0 |
| Linux | Linux | 18c91bb2d87268d23868bf13508f5bc9cf04e89a, 18c91bb2d87268d23868bf13508f5bc9cf04e89a, 6.18 |
| amazon:2023 | bpftool | 0 |
| amazon:2023 | kernel-modules-extra | 0 |
…and 12 more
Timeline
- Nov 12, 2025 Coalition ESS Score (4 in total, the first dated here)
- Nov 12, 2025 CVE Published
- Nov 13, 2025 EPSS Score (30 in total, the first dated here)
- Dec 15, 2025 Security Advisory (118 in total, the first dated here)
- Mar 29, 2026 Distribution Patch (102 in total, the first dated here)
- Sep 24, 2026 CVE Updated
Query this with the API
The same record, from the CLI:
vulnetix vdb vuln CVE-2025-40201
vulnetix vdb fixes CVE-2025-40201
Or with curl, using the org id and key from your account page:
curl -s -H "Authorization: ApiKey ${VULNETIX_ORG_ID}:${VULNETIX_API_KEY}" \
"https://api.vdb.vulnetix.com/v2/vuln/CVE-2025-40201/fixes/registry"
The Community plan is free and allows 50 queries a day. Get a free API key · API quickstart