{"schema":"/api/v1/schema/cve.json","api_version":"1","id":"CVE-2025-40039","published":"2025-10-28T12:15:37.847000Z","last_modified":"2026-10-19T21:10:00.160000Z","status":"Modified","cvss":{"version":"3.1","score":4.7,"severity":"MEDIUM","vector":"CVSS:3.1/AV:L/AC:H/PR:L/UI:N/S:U/C:N/I:N/A:H","source":"nvd@nist.gov","primary":true},"auth":true,"cwes":["CWE-362"],"cpes":[{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"5.15.145","version_end_excluding":"5.16"},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"6.1.71","version_end_excluding":"6.2"},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"6.3","version_end_excluding":"6.6.123"},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"6.7","version_end_excluding":"6.12.53"},{"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","part":"o","vendor":"linux","product":"linux_kernel","version_start_including":"6.13","version_end_excluding":"6.17.3"}],"cpes_truncated":false,"vendors":["linux"],"products":["linux/linux_kernel"],"cat":"os","platform":"linux","eol":false,"packages":[],"severity":"medium","priority_score":28,"links":{"html_es":"/es/cve/CVE-2025-40039/","html_en":"/en/cve/CVE-2025-40039/","nvd":"https://nvd.nist.gov/vuln/detail/CVE-2025-40039","cve_org":"https://www.cve.org/CVERecord?id=CVE-2025-40039"},"untrusted":{"vendor_name":"Linux","product_name":"Linux Kernel","desc_en":"In the Linux kernel, the following vulnerability has been resolved:\n\nksmbd: Fix race condition in RPC handle list access\n\nThe 'sess->rpc_handle_list' XArray manages RPC handles within a ksmbd\nsession. Access to this list is intended to be protected by\n'sess->rpc_lock' (an rw_semaphore). However, the locking implementation was\nflawed, leading to potential race conditions.\n\nIn ksmbd_session_rpc_open(), the code incorrectly acquired only a read lock\nbefore calling xa_store() and xa_erase(). Since these operations modify\nthe XArray structure, a write lock is required to ensure exclusive access\nand prevent data corruption from concurrent modifications.\n\nFurthermore, ksmbd_session_rpc_method() accessed the list using xa_load()\nwithout holding any lock at all. This could lead to reading inconsistent\ndata or a potential use-after-free if an entry is concurrently removed and\nthe pointer is dereferenced.\n\nFix these issues by:\n1. Using down_write() and up_write() in ksmbd_session_rpc_open()\n   to ensure exclusive access during XArray modification, and ensuring\n   the lock is correctly released on error paths.\n2. Adding down_read() and up_read() in ksmbd_session_rpc_method()\n   to safely protect the lookup.","affected":[{"untrusted_vendor":"Linux","untrusted_product":"Linux","versions":[]}],"references":[{"url":"https://git.kernel.org/stable/c/305853cce379407090a73b38c5de5ba748893aee","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/5cc679ba0f4505936124cd4179ba66bb0a4bd9f3","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/69674b029002b1d90b655f014bdf64f404efa54d","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/6b615a8fb3af0baf8126cde3d4fee97d57222ffc","tags":["Patch"]},{"url":"https://git.kernel.org/stable/c/6bd7e0e55dcea2cf0d391bbc21c2eb069b4be3e1","tags":["Patch"]}]},"bulletins":[{"source":"suse","id":"openSUSE-SU-2026:10301-1","url":"https://www.suse.com/support/update/","published":"2026-03-07T00:00:00+00:00","severity":"critical","exploited":false,"untrusted":{"title":"kernel-devel-longterm-6.18.16-1.1 on GA media"}}]}