CVE-2025-22041 ksmbd: fix use-after-free in ksmbd_sessions_deregister()

High 8.8 Published Updated

A use-after-free in the Linux kernel ksmbd module allows attackers to potentially execute code or escalate privileges via multichannel SMB sessions.

Exploited in the wild
Not known
Login needed
Any signed-in user
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-22041?

CVE-2025-22041 is a high-severity use after free vulnerability in Linux kernel, published on 16 Apr 2025. Any signed-in user can exploit it over the network, with no action from the victim.

Official 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.

Weakness: CWE-416

Which versions are affected by CVE-2025-22041?

It affects 1 product.

Products include Linux kernel.

How do I fix CVE-2025-22041?

Apply the vendor's patch.

Upgrade to the fixed version. These bugs are found with fuzzing and sanitisers and avoided by memory-safe languages. More about Use after free.

Is CVE-2025-22041 being exploited?

There is no known exploitation of CVE-2025-22041 in the wild and no public exploit code.

All Linux kernel vulnerabilities

Sources

Also known as BELL-CVE-2025-22041, DEBIAN-CVE-2025-22041, GHSA-gj89-4h85-hv53, ROOT-OS-UBUNTU-2204-CVE-2025-22041, ROOT-OS-UBUNTU-2404-CVE-2025-22041, UBUNTU-CVE-2025-22041.

Is CVE-2025-22041 in your software?

Upload an SBOM and sbomify checks it against every vulnerability here, every day.

Check your SBOMs for free