5.5medium
ksmbd: fix infinite loop caused by next_smb2_rcv_hdr_off reset in error paths
- Severity
- 5.5medium CVSS:3.1 by NVD
- Exploit likelihood
- 0.14% (higher than 3% of CVEs; EPSS, by FIRST)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix infinite loop caused by next_smb2_rcv_hdr_off reset in error paths The problem occurs when a signed request fails smb2 signature verification check. In __process_request(), if check_sign_req() returns an error, set_smb2_rsp_status(work, STATUS_ACCESS_DENIED) is called. set_smb2_rsp_status() set work->next_smb2_rcv_hdr_off as zero. By resetting next_smb2_rcv_hdr_off to zero, the pointer to the next command in the chain is lost. Consequently, is_chained_smb2_message() continues to point to the same request header instead of advancing. If the header's NextCommand field is non-zero, the function returns true, causing __handle_ksmbd_work() to repeatedly process the same failed request in an infinite loop. This results in the kernel log being flooded with "bad smb2 signature" messages and high CPU usage. This patch fixes the issue by changing the return value from SERVER_HANDLER_CONTINUE to SERVER_HANDLER_ABORT. This ensures that the processing loop terminates immediately rather than attempting to continue from an invalidated offset.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 4b9b7ea1ffb1e34f01fa5726d0c184931b9ba565 before 544adb0a6658ea1bff4064723761dbf05f95b1e2, from 943cebf9ea3415ddefcd670d24d8883e97ba3d60 before fb3b66bd72deb5543addaefa67963b34fb163a7b, from be0f89d4419dc5413a1cf06db3671c9949be0d52 before 5accdc5b7f28a81bbc5880ac0b8886e60c86e8c8, from be0f89d4419dc5413a1cf06db3671c9949be0d52 before f7b1c2f5642bbd60b1beef1f3298cbac81eb232c, from be0f89d4419dc5413a1cf06db3671c9949be0d52 before 71b5e7c528315ca360a1825a4ad2f8ae48c5dc16, from be0f89d4419dc5413a1cf06db3671c9949be0d52 before 9135e791ec2709bcf0cda0335535c74762489498, from be0f89d4419dc5413a1cf06db3671c9949be0d52 before 010eb01ce23b34b50531448b0da391c7f05a72af, from 5.15.145 before 5.15.203 and 2 more Not affected: before 6.6, from 5.15.203 up to 5.15.*, from 6.1.164 up to 6.1.*, from 6.6.125 up to 6.6.*, from 6.12.72 up to 6.12.*, from 6.18.11 up to 6.18.* | CVE List |
| linux linux_kernel | from 5.15.145 before 5.16, from 6.1.71 before 6.1.164, from 6.6.1 before 6.6.125, from 6.7 before 6.12.72, from 6.13 before 6.18.11, from 6.19 before 6.19.1, 6.6 | NVD |
Classification
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: ksmbd: fix infinite loop caused by next_smb2_rcv_hdr_off reset in error paths The problem occurs when a signed request fails smb2 signature verification check. In __process_request(), if check_sign_req() returns an error, set_smb2_rsp_status(work, STATUS_ACCESS_DENIED) is called. set_smb2_rsp_status() set work->next_smb2_rcv_hdr_off as zero. By resetting next_smb2_rcv_hdr_off to zero, the pointer to the next command in the chain is lost. Consequently, is_chained_smb2_message() continues to point to the same request header instead of advancing. If the header's NextCommand field is non-zero, the function returns true, causing __handle_ksmbd_work() to repeatedly process the same failed request in an infinite loop. This results in the kernel log being flooded with "bad smb2 signature" messages and high CPU usage. This patch fixes the issue by changing the return value from SERVER_HANDLER_CONTINUE to SERVER_HANDLER_ABORT. This ensures that the processing loop terminates immediately rather than attempting to continue from an invalidated offset.
NVD (es)
Se ha resuelto la siguiente vulnerabilidad en el kernel de Linux: ksmbd: corrige un bucle infinito causado por el reinicio de next_smb2_rcv_hdr_off en las rutas de error El problema ocurre cuando una solicitud firmada falla la verificación de firma smb2. En __process_request(), si check_sign_req() devuelve un error, se llama a set_smb2_rsp_status(work, STATUS_ACCESS_DENIED). set_smb2_rsp_status() establece work->next_smb2_rcv_hdr_off a cero. Al reiniciar next_smb2_rcv_hdr_off a cero, el puntero al siguiente comando en la cadena se pierde. En consecuencia, is_chained_smb2_message() continúa apuntando a la misma cabecera de solicitud en lugar de avanzar. Si el campo NextCommand de la cabecera no es cero, la función devuelve verdadero, lo que hace que __handle_ksmbd_work() procese repetidamente la misma solicitud fallida en un bucle infinito. Esto resulta en el registro del kernel siendo inundado con mensajes de 'firma smb2 incorrecta' y un alto uso de CPU. Este parche corrige el problema cambiando el valor de retorno de SERVER_HANDLER_CONTINUE a SERVER_HANDLER_ABORT. Esto asegura que el bucle de procesamiento termine inmediatamente en lugar de intentar continuar desde un desplazamiento invalidado.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-23220 changed 2026-06-02 | CVE Terms of Use |
| NVD | CVE-2026-23220 changed 2026-06-17 | Public domain |