CVE-2025-40285
smb/server: fix possible refcount leak in smb2_sess_setup()
Mitigation
- Upgrade Linux to 5.16 or later.
Who should check
- Anyone running Linux >= 37a0e2b362b3150317fb6e2139de67b1e29ae5ff, < 6fc935f798d44a8eb8a5e6659198399fbf57b981; >= 450a844c045ff0895d41b05a1cbe8febd1acfcfd, < e671f9bb97805771380c98de944e2ceab6949188; >= a39e31e22a535d47b14656a7d6a893c7f6cf758c, < dcc51dfe6ff26b52cac106865a172ac982d78401; >= b95629435b84b9ecc0c765995204a4d8a913ed52, < d37b2c81c83d6c0d5ca582f4fe73c672983f9e0d; >= b95629435b84b9ecc0c765995204a4d8a913ed52, < 379510a815cb2e64eb0a379cb62295d6ade65df0; 2107ab40629aeabbec369cf34b8cf0f288c3eb1b; >= 6.1.121, < 6.1.159; >= 6.6.67, < 6.6.117; >= 6.12.6, < 6.12.59; >= 5.15.176, < 5.16
- Anyone running Linux 6.13
Vulnerability facts
- Affected
- Linux >= 37a0e2b362b3150317fb6e2139de67b1e29ae5ff, < 6fc935f798d44a8eb8a5e6659198399fbf57b981; >= 450a844c045ff0895d41b05a1cbe8febd1acfcfd, < e671f9bb97805771380c98de944e2ceab6949188; >= a39e31e22a535d47b14656a7d6a893c7f6cf758c, < dcc51dfe6ff26b52cac106865a172ac982d78401; >= b95629435b84b9ecc0c765995204a4d8a913ed52, < d37b2c81c83d6c0d5ca582f4fe73c672983f9e0d; >= b95629435b84b9ecc0c765995204a4d8a913ed52, < 379510a815cb2e64eb0a379cb62295d6ade65df0; 2107ab40629aeabbec369cf34b8cf0f288c3eb1b; >= 6.1.121, < 6.1.159; >= 6.6.67, < 6.6.117; >= 6.12.6, < 6.12.59; >= 5.15.176, < 5.16; Linux 6.13
- Fixed in
- Linux 6fc935f798d44a8eb8a5e6659198399fbf57b981, Linux 379510a815cb2e64eb0a379cb62295d6ade65df0, Linux 6.1.159, Linux 6.6.117, Linux 6.12.59, Linux 5.16
- Exploited in the wild
- Not in CISA KEV
- Public exploit / PoC
- None known
- Remote exploitation
- Remote, no login needed
- CVSS
- 7.5 (v3.1, CNA)CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:HOpen in CVSS calculator
Show all 8 CVSS metrics
- Attack vector: Network
- Attack complexity: Low
- Privileges required: None
- User interaction: None
- Scope: Unchanged
- Confidentiality impact: None
- Integrity impact: None
- Availability impact: High
- EPSS
- 0.84% chance of exploitation in 30 days (percentile 55, 2026-11-26)
- Modified
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().
Affected and fixed versions
| Package / product | Affected | Fixed | Source |
|---|---|---|---|
| Linux | >= 37a0e2b362b3150317fb6e2139de67b1e29ae5ff, < 6fc935f798d44a8eb8a5e6659198399fbf57b981; >= 450a844c045ff0895d41b05a1cbe8febd1acfcfd, < e671f9bb97805771380c98de944e2ceab6949188; >= a39e31e22a535d47b14656a7d6a893c7f6cf758c, < dcc51dfe6ff26b52cac106865a172ac982d78401; >= b95629435b84b9ecc0c765995204a4d8a913ed52, < d37b2c81c83d6c0d5ca582f4fe73c672983f9e0d; >= b95629435b84b9ecc0c765995204a4d8a913ed52, < 379510a815cb2e64eb0a379cb62295d6ade65df0; 2107ab40629aeabbec369cf34b8cf0f288c3eb1b; >= 6.1.121, < 6.1.159; >= 6.6.67, < 6.6.117; >= 6.12.6, < 6.12.59; >= 5.15.176, < 5.16 | — | cvelist |
| Linux | 6.13 | — | cvelist |
Check your systems with an agent
Paste this into Claude Code, Cursor or another coding agent. It only reads; it changes nothing.
Check whether anything I run is affected by CVE-2025-40285. Work read-only: do not install, upgrade, delete or change anything. Details: https://flawdb.com/CVE-2025-40285.md Affected: Linux >= 37a0e2b362b3150317fb6e2139de67b1e29ae5ff, < 6fc935f798d44a8eb8a5e6659198399fbf57b981; >= 450a844c045ff0895d41b05a1cbe8febd1acfcfd, < e671f9bb97805771380c98de944e2ceab6949188; >= a39e31e22a535d47b14656a7d6a893c7f6cf758c, < dcc51dfe6ff26b52cac106865a172ac982d78401; >= b95629435b84b9ecc0c7659… Fixed in: Linux 6fc935f798d44a8eb8a5e6659198399fbf57b981, Linux 379510a815cb2e64eb0a379cb62295d6ade65df0, Linux 6.1.159, Linux 6.6.117, Linux 6.12.59, Linux 5.16 Steps: 1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services. 2. For each match, note the installed version and whether it is inside the affected range. 3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
References
Other
- https://git.kernel.org/stable/c/6fc935f798d44a8eb8a5e6659198399fbf57b981
- https://git.kernel.org/stable/c/e671f9bb97805771380c98de944e2ceab6949188
- https://git.kernel.org/stable/c/dcc51dfe6ff26b52cac106865a172ac982d78401
- https://git.kernel.org/stable/c/d37b2c81c83d6c0d5ca582f4fe73c672983f9e0d
- https://git.kernel.org/stable/c/379510a815cb2e64eb0a379cb62295d6ade65df0
FAQ
Is CVE-2025-40285 being exploited?
There is no confirmed exploitation: CVE-2025-40285 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.84% chance of exploitation in the next 30 days (as of 2026-11-26).
How serious is CVE-2025-40285?
High: CVSS 7.5 (v3.1, scored by CNA). Remote, no login needed.
Which versions are affected by CVE-2025-40285?
Linux >= 37a0e2b362b3150317fb6e2139de67b1e29ae5ff, < 6fc935f798d44a8eb8a5e6659198399fbf57b981; >= 450a844c045ff0895d41b05a1cbe8febd1acfcfd, < e671f9bb97805771380c98de944e2ceab6949188; >= a39e31e22a535d47b14656a7d6a893c7f6cf758c, < dcc51dfe6ff26b52cac106865a172ac982d78401; >= b95629435b84b9ecc0c765995204a4d8a913ed52, < d37b2c81c83d6c0d5ca582f4fe73c672983f9e0d; >= b95629435b84b9ecc0c765995204a4d8a913ed52, < 379510a815cb2e64eb0a379cb62295d6ade65df0; 2107ab40629aeabbec369cf34b8cf0f288c3eb1b; >= 6.1.121, < 6.1.159; >= 6.6.67, < 6.6.117; >= 6.12.6, < 6.12.59; >= 5.15.176, < 5.16; Linux 6.13.
Is there a fix for CVE-2025-40285?
Yes. Fixed in Linux 6fc935f798d44a8eb8a5e6659198399fbf57b981, Linux 379510a815cb2e64eb0a379cb62295d6ade65df0, Linux 6.1.159, Linux 6.6.117, Linux 6.12.59, Linux 5.16. Upgrade Linux to 5.16 or later.
How do I check if I'm affected by CVE-2025-40285?
Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.