Descripción
En el kernel de Linux, se resolvió la siguiente vulnerabilidad: lockd: Fix use-after-free in nlmsvc_retry_blocked nlmsvc_retry_blocked() examina el bloque al inicio de nlm_blocked bajo nlm_blocked_lock y luego libera el bloqueo antes de llamar a nlmsvc_grant_blocked() o retry_deferred_block(). La referencia de la lista nlm_blocked es lo único que mantiene vivo el bloque durante ese intervalo. nlmsvc_grant_blocked() sí toma una referencia propia, pero solo después de haber liberado el bloqueo. Desmontar el sistema de archivos nfsd mientras una solicitud de bloqueo sigue bloqueada llega a nlmsvc_traverse_blocks(), que elimina la referencia de la lista y libera el bloque junto con el nlm_rqst asociado. BUG: KASAN: slab-use-after-free in nlm_async_call+0xd6/0x230 Read of size 8 at addr ffff88811b04c808 by task lockd/8377 nlm_async_call+0xd6/0x230 nlmsvc_retry_blocked+0x61c/0x800 lockd+0x144/0x1c0 Freed by task 8392: nlmsvc_release_block+0x231/0x290 nlmsvc_traverse_blocks+0x139/0x1b0 nlm_traverse_files+0x1aa/0xa00 nlmsvc_free_host_resources+0x12/0x60 nlm_shutdown_hosts_net+0x127/0x280 lockd_down+0xd5/0x1c0 La corrección toma una referencia antes de liberar nlm_blocked_lock y la libera una vez ejecutado el reintento.
Qué hacer
Revisa si usas el producto afectado y en qué versión, y aplica la actualización o la mitigación que indique el aviso del fabricante. CISA no ha confirmado que se esté explotando; si eso cambia, esta ficha pasa a «explotada» y te avisamos en el boletín.
Versiones afectadas
- Linux Afectadas: 0e4ac9d93515b27fd7635332d73eae3192ed5d4e y anteriores a 6506c27da6756c0c7590ef60774ee5d35f6a4100 · 0e4ac9d93515b27fd7635332d73eae3192ed5d4e y anteriores a 70825b251e5f7855fd7bd93afc0b698154e00e70 · 0e4ac9d93515b27fd7635332d73eae3192ed5d4e y anteriores a 25d0baa6adb4a0b3f6889d42033ce8df3232bea7 · 0e4ac9d93515b27fd7635332d73eae3192ed5d4e y anteriores a f5b7634f0f213299a07b461fb10385c8639a4ab8
- Linux Afectadas: 2.6.22 No afectadas: 6.12.117 · 6.18.61 · 7.3.2 · 7.4-rc1
Según el registro de la vulnerabilidad en CVE.org, tal como lo publicó el fabricante. Confirma tu versión exacta en el aviso del fabricante.
Referencias
- Referencia en git.kernel.orggit.kernel.org/stable/c/6506c27da6756c0c7590ef60774ee5d35f6a4100
- Referencia en git.kernel.orggit.kernel.org/stable/c/70825b251e5f7855fd7bd93afc0b698154e00e70
- Referencia en git.kernel.orggit.kernel.org/stable/c/25d0baa6adb4a0b3f6889d42033ce8df3232bea7
- Referencia en git.kernel.orggit.kernel.org/stable/c/f5b7634f0f213299a07b461fb10385c8639a4ab8
Ver el texto original en inglés (CVE.org)
lockd: Fix use-after-free in nlmsvc_retry_blocked
In the Linux kernel, the following vulnerability has been resolved: lockd: Fix use-after-free in nlmsvc_retry_blocked nlmsvc_retry_blocked() examines the block at the head of nlm_blocked under nlm_blocked_lock, then releases the lock before calling nlmsvc_grant_blocked() or retry_deferred_block(). The nlm_blocked list reference is all that keeps the block alive across that window. nlmsvc_grant_blocked() does take one of its own, but not until after the lock has been dropped. Unmounting the nfsd filesystem while a lock request is still blocked reaches nlmsvc_traverse_blocks(), which drops the list reference and frees the block along with the nlm_rqst hanging off it. BUG: KASAN: slab-use-after-free in nlm_async_call+0xd6/0x230 Read of size 8 at addr ffff88811b04c808 by task lockd/8377 nlm_async_call+0xd6/0x230 nlmsvc_retry_blocked+0x61c/0x800 lockd+0x144/0x1c0 Freed by task 8392: nlmsvc_release_block+0x231/0x290 nlmsvc_traverse_blocks+0x139/0x1b0 nlm_traverse_files+0x1aa/0xa00 nlmsvc_free_host_resources+0x12/0x60 nlm_shutdown_hosts_net+0x127/0x280 lockd_down+0xd5/0x1c0 Take a reference before releasing nlm_blocked_lock and drop it once the retry has run.