CVE-2025-22041

ksmbd: fix use-after-free in ksmbd_sessions_deregister()

Published Apr 16, 2025 CVSS 3.1 · 8.8 High EPSS < 1% KEV · Not listed
Description
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.

Analysis

AI-generated

Technical impact

The vulnerability is a use‑after‑free in ksmbd_sessions_deregister() that can be triggered when a second SMB channel sets up a session while the first channel is still active. The freed session in the global session table can still be accessed through the connection’s session list, leading to kernel memory corruption. Because the code runs in privileged kernel space, an attacker could potentially craft SMB traffic to drive corrupted data into executable paths, allowing arbitrary code execution or a denial‑of‑service by crashing the kernel. The flaw is categorized as CWE‑416.

Affected Systems

All Linux kernels that include the ksmbd SMB server component are potentially affected. The specific release numbers are not listed in the data, but a patch commit is referenced in the kernel git log and a Debian LTS announcement indicates they will be patched in upcoming releases.

Risk and Exploitability

The CVSS score of 8.8 indicates a high impact, but the EPSS score of <1% signals that the likelihood of exploitation in the wild is currently very low. The flaw is not listed as a Known Exploited Vulnerability by CISA, so active exploitation is not confirmed. Attackers would need to reach the PSM server over SMB, either locally on the machine or remotely if the service is exposed, to send crafted requests that exercise the UAF path. No official workaround is supplied by the CNA.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the Linux kernel to a version that contains the ksmbd use‑after‑free fix; the patch is available in mainline kernel commits.
  • If SMB server functionality is not required, disable the ksmbd module (e.g., by omitting it from the kernel config or setting 'ksmbd=off' on boot).
  • If an immediate kernel upgrade is not possible, restrict SMB traffic to trusted IP addresses and monitor for abnormal session activity.

Generated by OpenCVE AI on April 28, 2026 at 02:18 UTC.

Tracking

Sign in to view the affected projects.

Advisories

Source ID Title
Debian DLA Debian DLA DLA-4193-1 linux-6.1 security update
Debian DSA Debian DSA DSA-5907-1 linux security update
EUVD EUVD EUVD-2025-11254 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.
Ubuntu USN Ubuntu USN USN-7594-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-7594-2 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-7594-3 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-7605-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-7605-2 Linux kernel (Low Latency) vulnerabilities
Ubuntu USN Ubuntu USN USN-7606-1 Linux kernel (OEM) vulnerabilities
Ubuntu USN Ubuntu USN USN-7628-1 Linux kernel (Azure) vulnerabilities
Ubuntu USN Ubuntu USN USN-7835-1 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-7835-2 Linux kernel (Real-time) vulnerabilities
Ubuntu USN Ubuntu USN USN-7835-3 Linux kernel vulnerabilities
Ubuntu USN Ubuntu USN USN-7835-4 Linux kernel (HWE) vulnerabilities
Ubuntu USN Ubuntu USN USN-7835-5 Linux kernel (Oracle) vulnerabilities
Ubuntu USN Ubuntu USN USN-7835-6 Linux kernel (AWS) vulnerabilities
Ubuntu USN Ubuntu USN USN-7887-1 Linux kernel (Raspberry Pi Real-time) vulnerabilities
Ubuntu USN Ubuntu USN USN-7887-2 Linux kernel (Raspberry Pi) vulnerabilities
Ubuntu USN Ubuntu USN USN-7940-1 Linux kernel (Azure FIPS) vulnerabilities
Ubuntu USN Ubuntu USN USN-7940-2 Linux kernel (Azure, N-Series) vulnerabilities
History
Type Values Removed Values Added
Metrics cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}

cvssV3_1

{'score': 8.8, 'vector': 'CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
Type Values Removed Values Added
Weaknesses CWE-416
Metrics cvssV3_1

{'score': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H'}

ssvc

{'options': {'Automatable': 'no', 'Exploitation': 'none', 'Technical Impact': 'total'}, 'version': '2.0.3'}

cvssV3_1

{'score': 7.8, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H'}

Type Values Removed Values Added
References
Metrics threat_severity

None

cvssV3_1

{'score': 5.5, 'vector': 'CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H'}

threat_severity

Low

Type Values Removed Values Added
Description 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.
Title ksmbd: fix use-after-free in ksmbd_sessions_deregister()
References
Weaknesses

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Aug 5, 2026, 11:56 AM
Reserved
Dec 29, 2024, 8:45 AM
Status
Modified
Published
Apr 16, 2025, 3:15 PM
Modified
Jun 17, 2026, 8:44 AM
Severity
Low
Public date
Apr 16, 2025, 12:00 AM