CVE-2025-37947

Published May 20, 2025

Last updated 3 months ago

Overview

AI description

Automated description summarized from trusted sources.

CVE-2025-37947 is a vulnerability found in the Linux kernel's ksmbd filesystem component, specifically within the `ksmbdvfsstream_write()` function. Disclosed on May 20, 2025, the vulnerability arises from a missing bounds check in the `ksmbdvfsstreamwrite()` function. The function doesn't validate if the write offset (`*pos`) is within the bounds of the existing stream data length (`vlen`). If `*pos` is greater than or equal to `v_len`, it can lead to an out-of-bounds memory write. Successful exploitation of this vulnerability could result in out-of-bounds memory writes in the Linux kernel, potentially causing memory corruption or system crashes. A patch has been implemented to address this issue by adding a validation check for the write offset in `ksmbdvfsstreamwrite()`. The fix ensures that `*pos` is less than `vlen` before proceeding with the write operation, returning `-EINVAL` if the condition fails.

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.
Source
416baaa9-dc9f-4396-8d5f-8c081fb06d67
NVD status
Modified
Products
linux_kernel, debian_linux

Risk scores

CVSS 3.1

Type
Primary
Base score
7.8
Impact score
5.9
Exploitability score
1.8
Vector string
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H
Severity
HIGH

Weaknesses

nvd@nist.gov
CWE-787
134c704f-9b21-4f2e-91b3-4a467353bcc0
CWE-787

Social media

Hype score
Not currently trending
  1. ksmbd - Exploiting CVE-2025-37947 (3/3) #CVE202537947 #ksmbd #OOBWrite #PrivilegeEscalation #LinuxKernel https://t.co/E4fuSaYTiu

    @reverseame

    2 Feb 2026

    1000 Impressions

    4 Retweets

    7 Likes

    4 Bookmarks

    0 Replies

    0 Quotes

  2. ksmbd - Exploiting CVE-2025-37947 (3/3) · Doyensec's Blog https://t.co/22HDfC4fjv

    @Komodosec

    17 Nov 2025

    0 Impressions

    0 Retweets

    0 Likes

    0 Bookmarks

    0 Replies

    0 Quotes

  3. Top 5 Trending CVEs: 1 - CVE-2021-28550 2 - CVE-2025-33073 3 - CVE-2023-20870 4 - CVE-2025-37947 5 - CVE-2025-22131 #cve #cvetrends #cveshield #cybersecurity https://t.co/4Fua3CAN6W

    @CVEShield

    26 Oct 2025

    11 Impressions

    0 Retweets

    0 Likes

    0 Bookmarks

    0 Replies

    0 Quotes

  4. ksmbd - Exploiting CVE-2025-37947 Article by @73696e65 about locally exploiting CVE-2025-37947 — a page OOB write in the ksmbd module. Article: https://t.co/V5LBTtOqxY Exploit: https://t.co/knpaTnIO2j https://t.co/jADk5UqFEn

    @linkersec

    24 Oct 2025

    12092 Impressions

    44 Retweets

    184 Likes

    58 Bookmarks

    0 Replies

    2 Quotes

  5. Linux kernel ksmbd モジュールの脆弱性 CVE-2025-37947:ローカル権限昇格と PoC の公開 https://t.co/02xnThNPhy この脆弱性の原因は、ksmbd_vfs_stream_write() における拡張属性 (xattr) 書き込みのサイズ検証不備にあります。割当

    @iototsecnews

    20 Oct 2025

    96 Impressions

    1 Retweet

    0 Likes

    0 Bookmarks

    0 Replies

    0 Quotes

  6. Exploiting CVE-2025-37947 (Linux kernel's ksmbd) https://t.co/3l5LuiehvQ

    @Karma_X_Inc

    19 Oct 2025

    74 Impressions

    0 Retweets

    0 Likes

    0 Bookmarks

    0 Replies

    0 Quotes

  7. ksmbd - Exploiting CVE-2025-37947 (3/3) https://t.co/J3XQM6nK4L

    @ytroncal

    12 Oct 2025

    43 Impressions

    0 Retweets

    0 Likes

    0 Bookmarks

    0 Replies

    0 Quotes

  8. CVE-2025-37947 : Linux kernel's ksmbd LPE Exploiting https://t.co/9BOFXgcoNH https://t.co/Sfw9mCfMrS

    @freedomhack101

    9 Oct 2025

    81 Impressions

    0 Retweets

    1 Like

    0 Bookmarks

    0 Replies

    0 Quotes

  9. #exploit #Kernel_Security Ksmbd Vulnerability Research Part 1 - CVE-2024-50283, CVE-2024-50285, CVE-2024-50286 - https://t.co/zoZsNbjEJK Part 2 - Fuzzing Improvements and Vulnerability Discovery - https://t.co/t1xCLqun8C Part 3 - Exploiting CVE-2025-37947 -

    @ksg93rd

    9 Oct 2025

    2937 Impressions

    10 Retweets

    50 Likes

    23 Bookmarks

    0 Replies

    0 Quotes

  10. csirt_it: ‼ #Linux: disponibile un #PoC per lo sfruttamento combinato della CVE-2025-37947 che interessa relative al modulo #KSMBD Rischio: 🟠 Tipologia: 🔸 Privilege Escalation 🔗 https://t.co/uEP8YyGW7C ⚠ Importante mantenere aggiornati i… https://t.co/A

    @Vulcanux_

    9 Oct 2025

    53 Impressions

    0 Retweets

    0 Likes

    0 Bookmarks

    0 Replies

    0 Quotes

  11. 🔥 Alerta crítico para admins Linux! Uma vulnerabilidade de alta gravidade (CVE-2025-37947) no ksmbd do kernel Linux permite escalada de privilégios para acesso root. Seus sistemas estão em risco! 🚨 Atualize suas distros AGORA. #Linux #CyberSecurity #CVE https://t.co/8Qt

    @fernandokarl

    9 Oct 2025

    42 Impressions

    0 Retweets

    0 Likes

    0 Bookmarks

    0 Replies

    0 Quotes

  12. ksmbd - Exploiting CVE-2025-37947 (3/3) https://t.co/AvRjgQT32z https://t.co/dKxpvu7YiR

    @Tinolle1955

    8 Oct 2025

    35 Impressions

    0 Retweets

    1 Like

    0 Bookmarks

    0 Replies

    0 Quotes

  13. ksmbd - Exploiting CVE-2025-37947 (3/3) https://t.co/7I0RV6RcYh

    @Dinosn

    8 Oct 2025

    929 Impressions

    0 Retweets

    1 Like

    3 Bookmarks

    0 Replies

    0 Quotes

Configurations

  1. In the Linux kernel, the following vulnerability has been resolved: cgroup: Avoid iteration of dying tasks with zero refcount The commit 260fbcb92bbea ("cgroup: Move dying_tasks cleanup from cgroup_task_release() to cgroup_task_free()") extended the lifetime of tasks on the dying_tasks list. The iterators have provision to go through dying_tasks because of dying threadgroup leaders or explicit CSS_TASK_ITER_WITH_DEAD, however, it was expected that such tasks can obtain a new reference (that is possible before cgroup_task_release()/put_task_struct_rcu_user()). The tasks after cgroup_task_release() and before cgroup_task_free() are subject to race when they may or may not have ->usage count > 0. The race window is between css_task_iter_next() invocations when css_set_lock is released and we may arrive at a new ->task_pos. The iterator should not attempt to resurrect tasks whose ->usage count dropped to zero. (When that happens, __put_task_struct_rcu_cb() is already imminent and the returned task_struct would could be used after free.) As for the fix, we cannot simply check the signal->live count of a task on the dying list because that won't distinguish regular zombies waiting to be reaped from RCU remnant tasks that are going to be free'd. Therefore add an extra check to rule out ->usage==0 tasks from any iteration. The repeat: loop in css_task_iter_advance() doesn't consider ->usage count, so add a new loop to css_task_iter_next() to skip de-used tasks on the dying_list. Rough illustration of the possible race R (reader of cgroup.procs) T (thread) L (group leader) --------------------------------- -------------------------------- -------------------------------- L exits, signal->live > 0 cgroup_task_dead(L) css_set_skip_task_iters() // skips only cset->tasks list_add_tail(&L->cg_list, &cset->dying_tasks) css_task_iter_next() take css_set_lock css_task_iter_advance() leader && signal->live != 0 => it->task_pos = &L->cg_list release css_set_lock T exits --signal->live == 0 cgroup_task_dead(T) // css_set_lock release_task(T) cgroup_task_release(T) release_task(L) // zap_leader cgroup_task_release(L) put_task_struct_rcu_user(L) ...RCU... put_task_struct(L) L->usage = 0 /* L still on dying_tasks */ ...RCU... __put_task_struct(L) css_task_iter_next() // another iteration take css_set_lock it->task_pos = &L->cg_list get_task_struct(L) => addition on 0 drop css_set_lock cgroup_task_free(L) css_set_skip_task_iters() // dying skip comes too late free_task(L) cgroup_procs_show() task_pid_vnr(L)•CVE-2026-98163