CVE-2025-22041
High · 8.8CVSS
8.8
EPSS
0.7%
Published
Apr 16, 2025
CISA due date
—
Cloudanix analysis
A flaw in the Linux kernel's file-sharing code can let attackers who already have login access take over affected computers.
- Exploitation
- Remote Authenticated
- Attacker needs
- Low Privilege
- Complexity
- Moderate
- Impact
- Full Compromise
- Component
- OS kernel
- Class
- Use After Free
- Remediation
- Upgrade
- Effort
- Medium
- Patch risk
- Low
What it actually does
Use-after-free in ksmbd_sessions_deregister() during multichannel SMB session setup, where a session freed via the global table remains accessible through the connection's sessions list.
Why it matters to the business
Remote attackers with valid SMB credentials can achieve arbitrary code execution on affected enterprise Linux systems, risking data theft, ransomware deployment, or full host compromise; high prevalence in Red Hat environments increases exposure for organizations running unpatched kernels.
How an attack unfolds
An attacker establishes an SMB multichannel connection, registers a session on the first channel, then triggers deregistration while the second channel still references the freed session object through the connection structure, leading to memory corruption and potential control-flow hijacking.
How to fix it
Upgrade all listed affected packages to version 0:4.18.0-372.129.1.el8_6 or later; apply the vendor kernel update immediately and reboot systems; disable ksmbd if multichannel SMB is not required.
How to confirm the fix worked
Verify installed kernel version matches or exceeds 4.18.0-372.129.1.el8_6; review kernel changelog for the ksmbd_sessions_deregister fix; test multichannel session teardown under load in a lab environment.
Typical attack path
- Obtain valid low-privileged SMB credentials on the target
- Initiate multichannel SMB session negotiation
- Register session via first channel and trigger concurrent deregistration
- Access dangling session pointer via second channel's connection list
- Trigger use-after-free to corrupt kernel memory and execute payload
How to detect it
Search kernel logs and audit trails for ksmbd session registration/deregistration errors or crashes around multichannel SMB activity; correlate with unexpected process terminations or memory corruption indicators in dmesg.
What your security team should do
- Apply the fixed kernel packages within 30 days given the high CVSS and enterprise exposure
- Restrict SMB access to trusted networks and enforce strong authentication
- Monitor for unusual ksmbd session activity in system logs
- Plan phased rollout and kernel compatibility testing for production workloads
The record
In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix use-after-free in ksmbd_sessions_deregister() In multichannel mode, UAF issue can occur in session_deregister when the second channel sets up a session through the connection of the first channel. session that is freed through the global session table can be accessed again through ->sessions of connection.
Affected packages
| Ecosystem | Package | Introduced | Fixed |
|---|---|---|---|
| Debian:11 | linux | 0 | No fix |
| Debian:11 | linux-6.1 | 0 | 6.1.137-1~deb11u1 |
| Debian:12 | linux | 0 | No fix |
| Debian:13 | linux | 0 | No fix |
| Debian:13 | linux | 0 | 6.12.25-1 |
| Linux | Kernel | 5.15.0 | 6.1.134 |
| Mageia:9 | kernel | 0 | 6.6.88-3.mga9 |
| Mageia:9 | kernel-linus | 0 | 6.6.88-1.mga9 |
| Mageia:9 | kmod-virtualbox | 0 | 7.0.24-70.mga9 |
| Mageia:9 | kmod-xtables-addons | 0 | 3.24-78.mga9 |
Related vulnerabilities
- CVE-2025-39885 In the Linux kernel, the following vulnerability has been resolved: ocfs2: fix recursive… Also affects linux
- CVE-2025-39883 In the Linux kernel, the following vulnerability has been resolved: mm/memory-failure… Also affects linux
- CVE-2025-39876 In the Linux kernel, the following vulnerability has been resolved: net: fec: Fix… Also affects linux
- CVE-2025-39869 In the Linux kernel, the following vulnerability has been resolved: dmaengine: ti: edma… Also affects linux
- CVE-2025-39873 In the Linux kernel, the following vulnerability has been resolved: can: xilinx_can… Also affects linux
- CVE-2025-39863 In the Linux kernel, the following vulnerability has been resolved: wifi: brcmfmac: fix… Also affects linux
- CVE-2025-39865 In the Linux kernel, the following vulnerability has been resolved: tee: fix NULL pointer… Also affects linux
- CVE-2025-39866 In the Linux kernel, the following vulnerability has been resolved: fs: writeback: fix… Also affects linux