5.5medium
drbd: fix "LOGIC BUG" in drbd_al_begin_io_nonblock()
- Severity
- 5.5medium CVSS:3.1 by NVD
- Exploit likelihood
- 0.19% (higher than 5% of CVEs)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: drbd: fix "LOGIC BUG" in drbd_al_begin_io_nonblock() Even though we check that we "should" be able to do lc_get_cumulative() while holding the device->al_lock spinlock, it may still fail, if some other code path decided to do lc_try_lock() with bad timing. If that happened, we logged "LOGIC BUG for enr=...", but still did not return an error. The rest of the code now assumed that this request has references for the relevant activity log extents. The implcations are that during an active resync, mutual exclusivity of resync versus application IO is not guaranteed. And a potential crash at this point may not realizs that these extents could have been target of in-flight IO and would need to be resynced just in case. Also, once the request completes, it will give up activity log references it does not even hold, which will trigger a BUG_ON(refcnt == 0) in lc_put(). Fix: Do not crash the kernel for a condition that is harmless during normal operation: also catch "e->refcnt == 0", not only "e == NULL" when being noisy about "al_complete_io() called on inactive extent %u\n". And do not try to be smart and "guess" whether something will work, then be surprised when it does not. Deal with the fact that it may or may not work. If it does not, remember a possible "partially in activity log" state (only possible for requests that cross extent boundaries), and return an error code from drbd_al_begin_io_nonblock(). A latter call for the same request will then resume from where we left off.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from 08a1ddab6df7d3c7b6341774cb1cf4b21b96a214 before 933d161baa3794547adee621c0bf52cbf2c1b3cd, from 08a1ddab6df7d3c7b6341774cb1cf4b21b96a214 before cf01aa6288e1190f89865e765056e2a9d8190639, from 08a1ddab6df7d3c7b6341774cb1cf4b21b96a214 before 7752569fc78e89794ce28946529850282233f99d, from 08a1ddab6df7d3c7b6341774cb1cf4b21b96a214 before e91d8d6565b7819d13dab21d4dbed5b45efba59b, from 08a1ddab6df7d3c7b6341774cb1cf4b21b96a214 before eef1390125b660b8b61f9f227a03bb9c5e6d36a5, from 08a1ddab6df7d3c7b6341774cb1cf4b21b96a214 before d1ef3aed4df2ef1fe46befd8f2da9a6ec5445508, from 08a1ddab6df7d3c7b6341774cb1cf4b21b96a214 before f558e5404a72054b525dced1a0c66aa95a144153, from 08a1ddab6df7d3c7b6341774cb1cf4b21b96a214 before ab140365fb62c0bdab22b2f516aff563b2559e3b and 1 more Not affected: before 3.10, from 5.10.253 up to 5.10.*, from 5.15.203 up to 5.15.*, from 6.1.167 up to 6.1.*, from 6.6.130 up to 6.6.*, from 6.12.77 up to 6.12.* | CVE List |
| linux linux_kernel | from 3.10.1 before 5.10.253, from 5.11 before 5.15.203, from 5.16 before 6.1.167, from 6.2 before 6.6.130, from 6.7 before 6.12.77, from 6.13 before 6.18.17, from 6.19 before 6.19.7, 3.10 and 1 more | NVD |
Classification
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: drbd: fix "LOGIC BUG" in drbd_al_begin_io_nonblock() Even though we check that we "should" be able to do lc_get_cumulative() while holding the device->al_lock spinlock, it may still fail, if some other code path decided to do lc_try_lock() with bad timing. If that happened, we logged "LOGIC BUG for enr=...", but still did not return an error. The rest of the code now assumed that this request has references for the relevant activity log extents. The implcations are that during an active resync, mutual exclusivity of resync versus application IO is not guaranteed. And a potential crash at this point may not realizs that these extents could have been target of in-flight IO and would need to be resynced just in case. Also, once the request completes, it will give up activity log references it does not even hold, which will trigger a BUG_ON(refcnt == 0) in lc_put(). Fix: Do not crash the kernel for a condition that is harmless during normal operation: also catch "e->refcnt == 0", not only "e == NULL" when being noisy about "al_complete_io() called on inactive extent %u\n". And do not try to be smart and "guess" whether something will work, then be surprised when it does not. Deal with the fact that it may or may not work. If it does not, remember a possible "partially in activity log" state (only possible for requests that cross extent boundaries), and return an error code from drbd_al_begin_io_nonblock(). A latter call for the same request will then resume from where we left off.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: drbd: corrige el 'LOGIC BUG' en drbd_al_begin_io_nonblock() Aunque verificamos que "deberíamos" poder hacer lc_get_cumulative() mientras mantenemos el spinlock device->al_lock, aún puede fallar, si alguna otra ruta de código decidió hacer lc_try_lock() con una sincronización deficiente. Si eso sucedía, registrábamos 'LOGIC BUG for enr=...', pero aún así no devolvíamos un error. El resto del código ahora asumía que esta solicitud tiene referencias para las extensiones de registro de actividad relevantes. Las implicaciones son que durante una resincronización activa, la exclusividad mutua de la resincronización frente a la E/S de la aplicación no está garantizada. Y un posible fallo en este punto podría no darse cuenta de que estas extensiones podrían haber sido objetivo de E/S en curso y necesitarían ser resincronizadas por si acaso. Además, una vez que la solicitud se completa, liberará referencias del registro de actividad que ni siquiera posee, lo que activará un BUG_ON(refcnt == 0) en lc_put(). Solución: No bloquear el kernel por una condición inofensiva durante el funcionamiento normal: también capturar 'e->refcnt == 0', no solo 'e == NULL' al ser ruidoso sobre 'al_complete_io() called on inactive extent %u\n'. Y no intentar ser inteligente y "adivinar" si algo funcionará, para luego sorprenderse cuando no lo haga. Afrontar el hecho de que puede o no funcionar. Si no funciona, recordar un posible estado de 'parcialmente en el registro de actividad' (solo posible para solicitudes que cruzan límites de extensión), y devolver un código de error desde drbd_al_begin_io_nonblock(). Una llamada posterior para la misma solicitud se reanudará desde donde lo dejamos.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2026-23356 changed 2026-10-15 | CVE Terms of Use |
| NVD | CVE-2026-23356 changed 2026-10-15 | Public domain |