CVE-2025-40039
Gravedad:
Pendiente de análisis
Tipo:
No Disponible / Otro tipo
Fecha de publicación:
28/10/2025
Última modificación:
06/02/2026
Descripción
*** Pendiente de traducción *** In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
ksmbd: Fix race condition in RPC handle list access<br />
<br />
The &#39;sess->rpc_handle_list&#39; XArray manages RPC handles within a ksmbd<br />
session. Access to this list is intended to be protected by<br />
&#39;sess->rpc_lock&#39; (an rw_semaphore). However, the locking implementation was<br />
flawed, leading to potential race conditions.<br />
<br />
In ksmbd_session_rpc_open(), the code incorrectly acquired only a read lock<br />
before calling xa_store() and xa_erase(). Since these operations modify<br />
the XArray structure, a write lock is required to ensure exclusive access<br />
and prevent data corruption from concurrent modifications.<br />
<br />
Furthermore, ksmbd_session_rpc_method() accessed the list using xa_load()<br />
without holding any lock at all. This could lead to reading inconsistent<br />
data or a potential use-after-free if an entry is concurrently removed and<br />
the pointer is dereferenced.<br />
<br />
Fix these issues by:<br />
1. Using down_write() and up_write() in ksmbd_session_rpc_open()<br />
to ensure exclusive access during XArray modification, and ensuring<br />
the lock is correctly released on error paths.<br />
2. Adding down_read() and up_read() in ksmbd_session_rpc_method()<br />
to safely protect the lookup.
Impacto
Referencias a soluciones, herramientas e información
- https://git.kernel.org/stable/c/305853cce379407090a73b38c5de5ba748893aee
- https://git.kernel.org/stable/c/5cc679ba0f4505936124cd4179ba66bb0a4bd9f3
- https://git.kernel.org/stable/c/69674b029002b1d90b655f014bdf64f404efa54d
- https://git.kernel.org/stable/c/6b615a8fb3af0baf8126cde3d4fee97d57222ffc
- https://git.kernel.org/stable/c/6bd7e0e55dcea2cf0d391bbc21c2eb069b4be3e1



