CVE-2025-40201: kernel/sys.c: fix the racy usage of task_lock(tsk->group_leader) in sys_prlimit64() paths
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.
Security readout for executives and security teams
Plain-English summary
A Linux kernel race can mishandle a process-leader reference while changing resource limits, potentially accessing freed memory. A local, low-privileged attacker may be able to compromise confidentiality, integrity, or availability. Exposure depends on the exact kernel branch and vendor backports.
Executive priority
Prioritize remediation for shared, multi-user, development, hosting, and other systems running untrusted local code. Treat as a high-priority kernel update, while recognizing that supplied evidence does not show remote or active exploitation.
Technical view
sys_prlimit64() protected a task_struct but not necessarily its group_leader. Concurrent process exit or multi-threaded exec could free or replace that leader while do_prlimit() locks it, causing use-after-free or mismatched locking. The stable fix takes tasklist_lock when necessary.
Likely exposure
Potentially exposed systems run an affected Linux kernel and permit untrusted local users or code execution. The bundle lists affected entries including 5.18, 6.1.157, 6.6.113, 6.12.54, 6.17.4, and 6.18, but does not clearly express complete version ranges.
Exploitation context
The CVSS vector indicates local access, low complexity, low privileges, and no user interaction, with potentially high confidentiality, integrity, and availability impact. The bundle says this CVE is not in KEV and provides no evidence of active exploitation or a public exploit.
Researcher notes
The source describes a concurrency-driven lifetime and locking flaw involving group_leader during prlimit handling. Exact affected ranges are ambiguous in the supplied flattened version data. Validate branch-specific ancestry and distributor backports against the five stable commits; do not infer exposure from version strings alone.
Mitigation direction
Update to a supported distribution kernel incorporating the applicable cited stable fix.
Confirm the corrected package with your Linux distributor because kernel fixes are commonly backported.
Until updated, restrict untrusted local accounts and workloads where operationally feasible.
Consult vendor guidance for additional mitigations; the supplied sources name no standalone workaround.
Validation and detection
Inventory running kernel versions across hosts, virtual machines, and appliances.
Check each distributor's advisory and package changelog for CVE-2025-40201 or a cited fix commit.
Verify the corrected kernel is running after installation and reboot.
Rescan affected assets and record vendor-specific backport evidence.
Generated from the cited source records. This long-tail analysis has not been individually reviewed by a named human.
Potential ATT&CK relevance
Conservative CVE-to-ATT&CK context
These mappings and lookup hints may be relevant to the vulnerability behavior, CWE, affected product, or exposure path. Glexia-inferred context is not an official MITRE, ATT&CK, CWE, or CVE Program mapping.
ATT&CK lookup starting points
Use these exact CWE pages and searches to review the Glexia ATT&CK library from this CVE's weakness and description context.
cve · low confidence lookup
CVE-2025-40201 mapping review
Open the CVE-to-ATT&CK bridge for reviewed, inferred, or future official mappings tied to this CVE.
These fields come from the CVE record and ADP containers, not from Glexia's Take. They preserve time-varying source decisions such as CISA SSVC, KEV status, CVSS metrics, and provider references.
1CVSS vectors
3Timeline events
0ADP providers
6Source links
CVSS vector scores
1 official score
We collect every scored CVSS vector available in the official CNA and ADP containers. When more than one version is present, the table keeps the source vectors side by side instead of collapsing them into the highest score.