{"id":"CVE-2025-40027","aliases":["CVE-2025-40027"],"related":[],"kind":"vulnerability","state":"published","title":"net/9p: fix double req put in p9_fd_cancelled","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet/9p: fix double req put in p9_fd_cancelled\n\nSyzkaller reports a KASAN issue as below:\n\ngeneral protection fault, probably for non-canonical address 0xfbd59c0000000021: 0000 [#1] PREEMPT SMP KASAN NOPTI\nKASAN: maybe wild-memory-access in range [0xdead000000000108-0xdead00000000010f]\nCPU: 0 PID: 5083 Comm: syz-executor.2 Not tainted 6.1.134-syzkaller-00037-g855bd1d7d838 #0\nHardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014\nRIP: 0010:__list_del include/linux/list.h:114 [inline]\nRIP: 0010:__list_del_entry include/linux/list.h:137 [inline]\nRIP: 0010:list_del include/linux/list.h:148 [inline]\nRIP: 0010:p9_fd_cancelled+0xe9/0x200 net/9p/trans_fd.c:734\n\nCall Trace:\n <TASK>\n p9_client_flush+0x351/0x440 net/9p/client.c:614\n p9_client_rpc+0xb6b/0xc70 net/9p/client.c:734\n p9_client_version net/9p/client.c:920 [inline]\n p9_client_create+0xb51/0x1240 net/9p/client.c:1027\n v9fs_session_init+0x1f0/0x18f0 fs/9p/v9fs.c:408\n v9fs_mount+0xba/0xcb0 fs/9p/vfs_super.c:126\n legacy_get_tree+0x108/0x220 fs/fs_context.c:632\n vfs_get_tree+0x8e/0x300 fs/super.c:1573\n do_new_mount fs/namespace.c:3056 [inline]\n path_mount+0x6a6/0x1e90 fs/namespace.c:3386\n do_mount fs/namespace.c:3399 [inline]\n __do_sys_mount fs/namespace.c:3607 [inline]\n __se_sys_mount fs/namespace.c:3584 [inline]\n __x64_sys_mount+0x283/0x300 fs/namespace.c:3584\n do_syscall_x64 arch/x86/entry/common.c:51 [inline]\n do_syscall_64+0x35/0x80 arch/x86/entry/common.c:81\n entry_SYSCALL_64_after_hwframe+0x6e/0xd8\n\nThis happens because of a race condition between:\n\n- The 9p client sending an invalid flush request and later cleaning it up;\n- The 9p client in p9_read_work() canceled all pending requests.\n\n      Thread 1                              Thread 2\n    ...\n    p9_client_create()\n    ...\n    p9_fd_create()\n    ...\n    p9_conn_create()\n    ...\n    // start Thread 2\n    INIT_WORK(&m->rq, p9_read_work);\n                                        p9_read_work()\n    ...\n    p9_client_rpc()\n    ...\n                                        ...\n                                        p9_conn_cancel()\n                                        ...\n                                        spin_lock(&m->req_lock);\n    ...\n    p9_fd_cancelled()\n    ...\n                                        ...\n                                        spin_unlock(&m->req_lock);\n                                        // status rewrite\n                                        p9_client_cb(m->client, req, REQ_STATUS_ERROR)\n                                        // first remove\n                                        list_del(&req->req_list);\n                                        ...\n\n    spin_lock(&m->req_lock)\n    ...\n    // second remove\n    list_del(&req->req_list);\n    spin_unlock(&m->req_lock)\n  ...\n\nCommit 74d6a5d56629 (\"9p/trans_fd: Fix concurrency del of req_list in\np9_fd_cancelled/p9_read_work\") fixes a concurrency issue in the 9p filesystem\nclient where the req_list could be deleted simultaneously by both\np9_read_work and p9_fd_cancelled functions, but for the case where req->status\nequals REQ_STATUS_RCVD.\n\nUpdate the check for req->status in p9_fd_cancelled to skip processing not\njust received requests, but anything that is not SENT, as whatever\nchanged the state from SENT also removed the request from its list.\n\nFound by Linux Verification Center (linuxtesting.org) with Syzkaller.\n\n[updated the check from status == RECV || status == ERROR to status != SENT]","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nnet/9p: fix double req put in p9_fd_cancelled\n\nSyzkaller reports a KASAN issue as below:\n\ngeneral protection fault, probably for non-canonical address 0xfbd59c0000000021: 0000 [#1] PREEMPT SMP KASAN NOPTI\nKASAN: maybe wild-memory-access in range [0xdead000000000108-0xdead00000000010f]\nCPU: 0 PID: 5083 Comm: syz-executor.2 Not tainted 6.1.134-syzkaller-00037-g855bd1d7d838 #0\nHardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014\nRIP: 0010:__list_del include/linux/list.h:114 [inline]\nRIP: 0010:__list_del_entry include/linux/list.h:137 [inline]\nRIP: 0010:list_del include/linux/list.h:148 [inline]\nRIP: 0010:p9_fd_cancelled+0xe9/0x200 net/9p/trans_fd.c:734\n\nCall Trace:\n <TASK>\n p9_client_flush+0x351/0x440 net/9p/client.c:614\n p9_client_rpc+0xb6b/0xc70 net/9p/client.c:734\n p9_client_version net/9p/client.c:920 [inline]\n p9_client_create+0xb51/0x1240 net/9p/client.c:1027\n v9fs_session_init+0x1f0/0x18f0 fs/9p/v9fs.c:408\n v9fs_mount+0xba/0xcb0 fs/9p/vfs_super.c:126\n legacy_get_tree+0x108/0x220 fs/fs_context.c:632\n vfs_get_tree+0x8e/0x300 fs/super.c:1573\n do_new_mount fs/namespace.c:3056 [inline]\n path_mount+0x6a6/0x1e90 fs/namespace.c:3386\n do_mount fs/namespace.c:3399 [inline]\n __do_sys_mount fs/namespace.c:3607 [inline]\n __se_sys_mount fs/namespace.c:3584 [inline]\n __x64_sys_mount+0x283/0x300 fs/namespace.c:3584\n do_syscall_x64 arch/x86/entry/common.c:51 [inline]\n do_syscall_64+0x35/0x80 arch/x86/entry/common.c:81\n entry_SYSCALL_64_after_hwframe+0x6e/0xd8\n\nThis happens because of a race condition between:\n\n- The 9p client sending an invalid flush request and later cleaning it up;\n- The 9p client in p9_read_work() canceled all pending requests.\n\n      Thread 1                              Thread 2\n    ...\n    p9_client_create()\n    ...\n    p9_fd_create()\n    ...\n    p9_conn_create()\n    ...\n    // start Thread 2\n    INIT_WORK(&m->rq, p9_read_work);\n                                        p9_read_work()\n    ...\n    p9_client_rpc()\n    ...\n                                        ...\n                                        p9_conn_cancel()\n                                        ...\n                                        spin_lock(&m->req_lock);\n    ...\n    p9_fd_cancelled()\n    ...\n                                        ...\n                                        spin_unlock(&m->req_lock);\n                                        // status rewrite\n                                        p9_client_cb(m->client, req, REQ_STATUS_ERROR)\n                                        // first remove\n                                        list_del(&req->req_list);\n                                        ...\n\n    spin_lock(&m->req_lock)\n    ...\n    // second remove\n    list_del(&req->req_list);\n    spin_unlock(&m->req_lock)\n  ...\n\nCommit 74d6a5d56629 (\"9p/trans_fd: Fix concurrency del of req_list in\np9_fd_cancelled/p9_read_work\") fixes a concurrency issue in the 9p filesystem\nclient where the req_list could be deleted simultaneously by both\np9_read_work and p9_fd_cancelled functions, but for the case where req->status\nequals REQ_STATUS_RCVD.\n\nUpdate the check for req->status in p9_fd_cancelled to skip processing not\njust received requests, but anything that is not SENT, as whatever\nchanged the state from SENT also removed the request from its list.\n\nFound by Linux Verification Center (linuxtesting.org) with Syzkaller.\n\n[updated the check from status == RECV || status == ERROR to status != SENT]","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta:\n\nnet/9p: corregir doble liberación de req en p9_fd_cancelled\n\nSyzkaller informa un problema de KASAN como sigue:\n\nfallo de protección general, probablemente para dirección no canónica 0xfbd59c0000000021: 0000 [#1] PREEMPT SMP KASAN NOPTI\nKASAN: quizás acceso a memoria salvaje en el rango [0xdead000000000108-0xdead00000000010f]\nCPU: 0 PID: 5083 Comm: syz-executor.2 No contaminado 6.1.134-syzkaller-00037-g855bd1d7d838 #0\nNombre del hardware: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.12.0-1 04/01/2014\nRIP: 0010:__list_del include/linux/list.h:114 [en línea]\nRIP: 0010:__list_del_entry include/linux/list.h:137 [en línea]\nRIP: 0010:list_del include/linux/list.h:148 [en línea]\nRIP: 0010:p9_fd_cancelled+0xe9/0x200 net/9p/trans_fd.c:734\n\nTraza de llamada:\n <TAREA>\n p9_client_flush+0x351/0x440 net/9p/client.c:614\n p9_client_rpc+0xb6b/0xc70 net/9p/client.c:734\n p9_client_version net/9p/client.c:920 [en línea]\n p9_client_create+0xb51/0x1240 net/9p/client.c:1027\n v9fs_session_init+0x1f0/0x18f0 fs/9p/v9fs.c:408\n v9fs_mount+0xba/0xcb0 fs/9p/vfs_super.c:126\n legacy_get_tree+0x108/0x220 fs/fs_context.c:632\n vfs_get_tree+0x8e/0x300 fs/super.c:1573\n do_new_mount fs/namespace.c:3056 [en línea]\n path_mount+0x6a6/0x1e90 fs/namespace.c:3386\n do_mount fs/namespace.c:3399 [en línea]\n __do_sys_mount fs/namespace.c:3607 [en línea]\n __se_sys_mount fs/namespace.c:3584 [en línea]\n __x64_sys_mount+0x283/0x300 fs/namespace.c:3584\n do_syscall_x64 arch/x86/entry/common.c:51 [en línea]\n do_syscall_64+0x35/0x80 arch/x86/entry/common.c:81\n entry_SYSCALL_64_after_hwframe+0x6e/0xd8\n\nEsto ocurre debido a una condición de carrera entre:\n\n- El cliente 9p enviando una solicitud de vaciado inválida y limpiándola posteriormente;\n- El cliente 9p en p9_read_work() canceló todas las solicitudes pendientes.\n\n      Hilo 1                              Hilo 2\n    ...\n    p9_client_create()\n    ...\n    p9_fd_create()\n    ...\n    p9_conn_create()\n    ...\n    // iniciar Hilo 2\n    INIT_WORK(&m->rq, p9_read_work);\n                                        p9_read_work()\n    ...\n    p9_client_rpc()\n    ...\n                                        ...\n                                        p9_conn_cancel()\n                                        ...\n                                        spin_lock(&m->req_lock);\n    ...\n    p9_fd_cancelled()\n    ...\n                                        ...\n                                        spin_unlock(&m->req_lock);\n                                        // reescritura de estado\n                                        p9_client_cb(m->client, req, REQ_STATUS_ERROR)\n                                        // primera eliminación\n                                        list_del(&req->req_list);\n                                        ...\n\n    spin_lock(&m->req_lock)\n    ...\n    // segunda eliminación\n    list_del(&req->req_list);\n    spin_unlock(&m->req_lock)\n  ...\n\nEl commit 74d6a5d56629 (“9p/trans_fd: Fix concurrency del of req_list in p9_fd_cancelled/p9_read_work”) corrige un problema de concurrencia en el cliente del sistema de archivos 9p donde la req_list podría ser eliminada simultáneamente por las funciones p9_read_work y p9_fd_cancelled, pero para el caso en que req->status es igual a REQ_STATUS_RCVD.\n\nActualizar la verificación de req->status en p9_fd_cancelled para omitir el procesamiento no solo de las solicitudes recibidas, sino de cualquier cosa que no sea ENVIADA, ya que lo que sea que haya cambiado el estado de ENVIADA también eliminó la solicitud de su lista.\n\nEncontrado por Linux Verification Center (linuxtesting.org) con Syzkaller.\n\n[se actualizó la verificación de status == RECV || status == ERROR a status != SENT]","source":"nvd"}],"published":"2025-10-28T09:32:34.162Z","modified":"2026-10-19T21:10:00.160Z","severity":{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"},"severities":[{"scorer":"Linux","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","score":7.8,"rating":"HIGH"}],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"afd8d65411551839b7ab14a539d00075b2793451","fixed":"a5901a0dfb5964525990106706ae8b98db098226","status":"affected"},{"type":"git","introduced":"afd8d65411551839b7ab14a539d00075b2793451","fixed":"5c64c0b7b3446f7ed088a13bc8d7487d66534cbb","status":"affected"},{"type":"git","introduced":"afd8d65411551839b7ab14a539d00075b2793451","fixed":"c1db864270eb7fea94a9ef201da0c9dc1cbab7b8","status":"affected"},{"type":"git","introduced":"afd8d65411551839b7ab14a539d00075b2793451","fixed":"0e0097005abc02c9f262370674f855625f4f3fb4","status":"affected"},{"type":"git","introduced":"afd8d65411551839b7ab14a539d00075b2793451","fixed":"284e67a93b8c48952b6fc82129a8d3eb9dc73b06","status":"affected"},{"type":"git","introduced":"afd8d65411551839b7ab14a539d00075b2793451","fixed":"716dceb19a9f8ff6c9d3aee5a771a93d6a47a0b6","status":"affected"},{"type":"git","introduced":"afd8d65411551839b7ab14a539d00075b2793451","fixed":"448db01a48e1cdbbc31c995716a5dac1e52ba036","status":"affected"},{"type":"git","introduced":"afd8d65411551839b7ab14a539d00075b2793451","fixed":"94797b84cb9985022eb9cb3275c9497fbc883bb6","status":"affected"},{"type":"git","introduced":"afd8d65411551839b7ab14a539d00075b2793451","fixed":"674b56aa57f9379854cb6798c3bbcef7e7b51ab7","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"3.15","status":"affected"},{"type":"semver","introduced":"0","fixed":"3.15","status":"unaffected"},{"type":"semver","introduced":"5.4.301","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.246","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.195","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.156","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.111","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.52","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.16.12","lastAffected":"6.16.*","status":"unaffected"},{"type":"semver","introduced":"6.17.2","lastAffected":"6.17.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.18","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/a5901a0dfb5964525990106706ae8b98db098226","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/5c64c0b7b3446f7ed088a13bc8d7487d66534cbb","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c1db864270eb7fea94a9ef201da0c9dc1cbab7b8","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/0e0097005abc02c9f262370674f855625f4f3fb4","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/284e67a93b8c48952b6fc82129a8d3eb9dc73b06","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/716dceb19a9f8ff6c9d3aee5a771a93d6a47a0b6","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/448db01a48e1cdbbc31c995716a5dac1e52ba036","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/94797b84cb9985022eb9cb3275c9497fbc883bb6","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/674b56aa57f9379854cb6798c3bbcef7e7b51ab7","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-40027","url":"https://www.cve.org/CVERecord?id=CVE-2025-40027","licence":"CVE Terms of Use","modified":"2026-08-05T12:07:09.837Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-40027","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-40027","licence":"Public domain","modified":"2026-10-19T21:10:00.160Z"}],"updatedAt":"2026-11-25T22:59:06.923Z","epss":{"score":0.00165,"percentile":0.05992,"date":"2026-12-01T12:00:22.000Z"}}