CVE-2025-40027
Gravedad:
Pendiente de análisis
Tipo:
No Disponible / Otro tipo
Fecha de publicación:
28/10/2025
Última modificación:
30/10/2025
Descripción
*** Pendiente de traducción *** In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
net/9p: fix double req put in p9_fd_cancelled<br />
<br />
Syzkaller reports a KASAN issue as below:<br />
<br />
general protection fault, probably for non-canonical address 0xfbd59c0000000021: 0000 [#1] PREEMPT SMP KASAN NOPTI<br />
KASAN: maybe wild-memory-access in range [0xdead000000000108-0xdead00000000010f]<br />
CPU: 0 PID: 5083 Comm: syz-executor.2 Not tainted 6.1.134-syzkaller-00037-g855bd1d7d838 #0<br />
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014<br />
RIP: 0010:__list_del include/linux/list.h:114 [inline]<br />
RIP: 0010:__list_del_entry include/linux/list.h:137 [inline]<br />
RIP: 0010:list_del include/linux/list.h:148 [inline]<br />
RIP: 0010:p9_fd_cancelled+0xe9/0x200 net/9p/trans_fd.c:734<br />
<br />
Call Trace:<br />
<br />
p9_client_flush+0x351/0x440 net/9p/client.c:614<br />
p9_client_rpc+0xb6b/0xc70 net/9p/client.c:734<br />
p9_client_version net/9p/client.c:920 [inline]<br />
p9_client_create+0xb51/0x1240 net/9p/client.c:1027<br />
v9fs_session_init+0x1f0/0x18f0 fs/9p/v9fs.c:408<br />
v9fs_mount+0xba/0xcb0 fs/9p/vfs_super.c:126<br />
legacy_get_tree+0x108/0x220 fs/fs_context.c:632<br />
vfs_get_tree+0x8e/0x300 fs/super.c:1573<br />
do_new_mount fs/namespace.c:3056 [inline]<br />
path_mount+0x6a6/0x1e90 fs/namespace.c:3386<br />
do_mount fs/namespace.c:3399 [inline]<br />
__do_sys_mount fs/namespace.c:3607 [inline]<br />
__se_sys_mount fs/namespace.c:3584 [inline]<br />
__x64_sys_mount+0x283/0x300 fs/namespace.c:3584<br />
do_syscall_x64 arch/x86/entry/common.c:51 [inline]<br />
do_syscall_64+0x35/0x80 arch/x86/entry/common.c:81<br />
entry_SYSCALL_64_after_hwframe+0x6e/0xd8<br />
<br />
This happens because of a race condition between:<br />
<br />
- The 9p client sending an invalid flush request and later cleaning it up;<br />
- The 9p client in p9_read_work() canceled all pending requests.<br />
<br />
Thread 1 Thread 2<br />
...<br />
p9_client_create()<br />
...<br />
p9_fd_create()<br />
...<br />
p9_conn_create()<br />
...<br />
// start Thread 2<br />
INIT_WORK(&m->rq, p9_read_work);<br />
p9_read_work()<br />
...<br />
p9_client_rpc()<br />
...<br />
...<br />
p9_conn_cancel()<br />
...<br />
spin_lock(&m->req_lock);<br />
...<br />
p9_fd_cancelled()<br />
...<br />
...<br />
spin_unlock(&m->req_lock);<br />
// status rewrite<br />
p9_client_cb(m->client, req, REQ_STATUS_ERROR)<br />
// first remove<br />
list_del(&req->req_list);<br />
...<br />
<br />
spin_lock(&m->req_lock)<br />
...<br />
// second remove<br />
list_del(&req->req_list);<br />
spin_unlock(&m->req_lock)<br />
...<br />
<br />
Commit 74d6a5d56629 ("9p/trans_fd: Fix concurrency del of req_list in<br />
p9_fd_cancelled/p9_read_work") fixes a concurrency issue in the 9p filesystem<br />
client where the req_list could be deleted simultaneously by both<br />
p9_read_work and p9_fd_cancelled functions, but for the case where req->status<br />
equals REQ_STATUS_RCVD.<br />
<br />
Update the check for req->status in p9_fd_cancelled to skip processing not<br />
just received requests, but anything that is not SENT, as whatever<br />
changed the state from SENT also removed the request from its list.<br />
<br />
Found by Linux Verification Center (linuxtesting.org) with Syzkaller.<br />
<br />
[updated the check from status == RECV || status == ERROR to status != SENT]
Impacto
Referencias a soluciones, herramientas e información
- https://git.kernel.org/stable/c/0e0097005abc02c9f262370674f855625f4f3fb4
- https://git.kernel.org/stable/c/284e67a93b8c48952b6fc82129a8d3eb9dc73b06
- https://git.kernel.org/stable/c/448db01a48e1cdbbc31c995716a5dac1e52ba036
- https://git.kernel.org/stable/c/5c64c0b7b3446f7ed088a13bc8d7487d66534cbb
- https://git.kernel.org/stable/c/674b56aa57f9379854cb6798c3bbcef7e7b51ab7
- https://git.kernel.org/stable/c/716dceb19a9f8ff6c9d3aee5a771a93d6a47a0b6
- https://git.kernel.org/stable/c/94797b84cb9985022eb9cb3275c9497fbc883bb6
- https://git.kernel.org/stable/c/a5901a0dfb5964525990106706ae8b98db098226
- https://git.kernel.org/stable/c/c1db864270eb7fea94a9ef201da0c9dc1cbab7b8



