CVE-2025-37947 ksmbd: prevent out-of-bounds stream writes by validating *pos
An out-of-bounds write in the ksmbd kernel module allows attackers to potentially execute code or escalate privileges via crafted stream write requests.
- 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-37947?
CVE-2025-37947 is a high-severity memory corruption vulnerability in Debian Debian Linux, published on 20 May 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: prevent out-of-bounds stream writes by validating *pos
ksmbd_vfs_stream_write() did not validate whether the write offset (*pos) was within the bounds of the existing stream data length (v_len). If *pos was greater than or equal to v_len, this could lead to an out-of-bounds memory write.
This patch adds a check to ensure *pos is less than v_len before proceeding. If the condition fails, -EINVAL is returned.
Weakness: CWE-787
Which versions are affected by CVE-2025-37947?
It affects 2 products.
Products include Debian Debian Linux, Linux kernel.
How do I fix CVE-2025-37947?
Apply the vendor's patch.
Upgrade to the fixed version. Memory-safe languages, compiler hardening and fuzzing prevent most new cases. More about Memory corruption.
Is CVE-2025-37947 being exploited?
It is not confirmed as exploited in the wild, but public exploit code for CVE-2025-37947 exists.
Public exploit code: 1 proofs of concept on GitHub.
Other vulnerabilities in Debian Debian Linux
Sources
Also known as BELL-CVE-2025-37947, DEBIAN-CVE-2025-37947, GHSA-c42x-xw5m-9j9p, ROOT-OS-DEBIAN-12-CVE-2025-37947, ROOT-OS-UBUNTU-2204-CVE-2025-37947, ROOT-OS-UBUNTU-2404-CVE-2025-37947 and 1 more.