CVE-2025-22040
kernel: ksmbd: fix session use-after-free in multichannel connection
Severity
ImportantRed Hat Product Security
CVSS 3.1
Review impact separately from score.
Published · April 16, 2025
Updated · October 30, 2026
Description
In the Linux kernel, the following vulnerability has been resolved:
ksmbd: fix session use-after-free in multichannel connection
There is a race condition between session setup and ksmbd_sessions_deregister. The session can be freed before the connection is added to channel list of session. This patch check reference count of session before freeing it.
Statement
This vulnerability is rated as Important because an authenticated user could exploit a race condition during SMB session handling to trigger memory corruption or kernel crashes, potentially compromising the host. Red Hat Enterprise Linux does not enable or compile the in-kernel SMB server (ksmbd), relying instead on user-space implementations such as Samba. As a result, default Red Hat Enterprise Linux installations are not vulnerable to this issue.
CVSS score applicability
The CVSS score(s) listed for this vulnerability do not reflect the associated product's status, and are included for informational purposes to better understand the severity of this vulnerability.
Mitigation
No mitigation is specified in collected source.
CVSS / CWE
CVSS 3.1 · 7.8CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
CWE-416 · Use After Free