CVE-2025-40285 smb/server: fix possible refcount leak in smb2_sess_setup()

High 7.5 Published Updated

A reference count leak in the Linux kernel SMB server can lead to resource exhaustion and denial of service.

Exploited in the wild
Not known
Login needed
Not needed
Attackable
Over the internet
Victim action needed
Not needed
Fix
Available

What is CVE-2025-40285?

CVE-2025-40285 is a high-severity denial of service vulnerability in Linux, published on 6 Dec 2025. An attacker can exploit it over the internet without logging in, with no action from the victim.

Official description

In the Linux kernel, the following vulnerability has been resolved:

smb/server: fix possible refcount leak in smb2_sess_setup()

Reference count of ksmbd_session will leak when session need reconnect. Fix this by adding the missing ksmbd_user_session_put().

Which versions are affected by CVE-2025-40285?

How do I fix CVE-2025-40285?

Apply the vendor's patch.

Upgrade, then put limits on request size, rate and nesting depth so one client cannot exhaust the service. More about Denial of service.

Is CVE-2025-40285 being exploited?

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

Sources

Also known as BELL-CVE-2025-40285, DEBIAN-CVE-2025-40285, GHSA-7645-fj87-x9w4, ROOT-OS-DEBIAN-12-CVE-2025-40285, ROOT-OS-DEBIAN-13-CVE-2025-40285, ROOT-OS-UBUNTU-2204-CVE-2025-40285 and 2 more.

Is CVE-2025-40285 in your software?

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

Check your SBOMs for free