CVE-2024-26696
JSON

5.5medium

nilfs2: fix hang in nilfs_lookup_dirty_data_buffers()

Severity
5.5medium CVSS:3.1 by NVD
Exploit likelihood
0.19% (higher than 9% of CVEs; EPSS, by FIRST)
Published
Last changed
Assigned by
Linux

Description

In the Linux kernel, the following vulnerability has been resolved: nilfs2: fix hang in nilfs_lookup_dirty_data_buffers() Syzbot reported a hang issue in migrate_pages_batch() called by mbind() and nilfs_lookup_dirty_data_buffers() called in the log writer of nilfs2. While migrate_pages_batch() locks a folio and waits for the writeback to complete, the log writer thread that should bring the writeback to completion picks up the folio being written back in nilfs_lookup_dirty_data_buffers() that it calls for subsequent log creation and was trying to lock the folio. Thus causing a deadlock. In the first place, it is unexpected that folios/pages in the middle of writeback will be updated and become dirty. Nilfs2 adds a checksum to verify the validity of the log being written and uses it for recovery at mount, so data changes during writeback are suppressed. Since this is broken, an unclean shutdown could potentially cause recovery to fail. Investigation revealed that the root cause is that the wait for writeback completion in nilfs_page_mkwrite() is conditional, and if the backing device does not require stable writes, data may be modified without waiting. Fix these issues by making nilfs_page_mkwrite() wait for writeback to finish regardless of the stable write requirement of the backing device.

Affected

Product or packageVersionsReported by
Linux Linuxfrom 1d1d1a767206fbe5d4c69493b7e6d2a8d08cc0a0 before 228742b2ddfb99dfd71e5a307e6088ab6836272e, from 1d1d1a767206fbe5d4c69493b7e6d2a8d08cc0a0 before 862ee4422c38be5c249844a684b00d0dbe9d1e46, from 1d1d1a767206fbe5d4c69493b7e6d2a8d08cc0a0 before 98a4026b22ff440c7f47056481bcbbe442f607d6, from 1d1d1a767206fbe5d4c69493b7e6d2a8d08cc0a0 before 7e9b622bd0748cc104d66535b76d9b3535f9dc0f, from 1d1d1a767206fbe5d4c69493b7e6d2a8d08cc0a0 before 8494ba2c9ea00a54d5b50e69b22c55a8958bce32, from 1d1d1a767206fbe5d4c69493b7e6d2a8d08cc0a0 before ea5ddbc11613b55e5128c85f57b08f907abd9b28, from 1d1d1a767206fbe5d4c69493b7e6d2a8d08cc0a0 before e38585401d464578d30f5868ff4ca54475c34f7d, from 1d1d1a767206fbe5d4c69493b7e6d2a8d08cc0a0 before 38296afe3c6ee07319e01bb249aa4bb47c07b534 and 1 more
Not affected: before 3.9, from 4.19.307 up to 4.19.*, from 5.4.269 up to 5.4.*, from 5.10.210 up to 5.10.*, from 5.15.149 up to 5.15.*, from 6.1.79 up to 6.1.*
CVE List
linux linux_kernelfrom 3.9 before 4.19.307, from 4.20 before 5.4.269, from 5.5 before 5.10.210, from 5.11 before 5.15.149, from 5.16 before 6.1.79, from 6.2 before 6.6.18, from 6.7 before 6.7.6, 6.8NVD
debian debian_linux10.0NVD

Classification

CWE-667

SSVC (CISA-ADP): exploitation none, automatable no, technical impact partial.

What each source says

CVE List

In the Linux kernel, the following vulnerability has been resolved: nilfs2: fix hang in nilfs_lookup_dirty_data_buffers() Syzbot reported a hang issue in migrate_pages_batch() called by mbind() and nilfs_lookup_dirty_data_buffers() called in the log writer of nilfs2. While migrate_pages_batch() locks a folio and waits for the writeback to complete, the log writer thread that should bring the writeback to completion picks up the folio being written back in nilfs_lookup_dirty_data_buffers() that it calls for subsequent log creation and was trying to lock the folio. Thus causing a deadlock. In the first place, it is unexpected that folios/pages in the middle of writeback will be updated and become dirty. Nilfs2 adds a checksum to verify the validity of the log being written and uses it for recovery at mount, so data changes during writeback are suppressed. Since this is broken, an unclean shutdown could potentially cause recovery to fail. Investigation revealed that the root cause is that the wait for writeback completion in nilfs_page_mkwrite() is conditional, and if the backing device does not require stable writes, data may be modified without waiting. Fix these issues by making nilfs_page_mkwrite() wait for writeback to finish regardless of the stable write requirement of the backing device.

NVD (es)

En el kernel de Linux, se resolvió la siguiente vulnerabilidad: nilfs2: corrige un bloqueo en nilfs_lookup_dirty_data_buffers() Syzbot informó un problema de bloqueo en migrar_pages_batch() llamado por mbind() y nilfs_lookup_dirty_data_buffers() llamado en el escritor de registros de nilfs2. Mientras migrar_pages_batch() bloquea una publicación y espera a que se complete la reescritura, el subproceso del escritor de registros que debería completar la reescritura recoge la publicación que se está reescribiendo en nilfs_lookup_dirty_data_buffers() que solicita la creación de registros posteriores y estaba intentando bloquear la fol. Provocando así un punto muerto. En primer lugar, es inesperado que los folios/páginas en medio de la reescritura se actualicen y se ensucien. Nilfs2 agrega una suma de verificación para verificar la validez del registro que se está escribiendo y la usa para la recuperación en el montaje, de modo que se suprimen los cambios de datos durante la reescritura. Dado que esto no funciona, un cierre incorrecto podría provocar que falle la recuperación. La investigación reveló que la causa principal es que la espera para que se complete la reescritura en nilfs_page_mkwrite() es condicional, y si el dispositivo de respaldo no requiere escrituras estables, los datos se pueden modificar sin esperar. Solucione estos problemas haciendo que nilfs_page_mkwrite() espere a que finalice la reescritura independientemente del requisito de escritura estable del dispositivo de respaldo.

References

Sources

SourceRecordLicence
CVE ListCVE-2024-26696 changed 2026-05-11CVE Terms of Use
NVDCVE-2024-26696 changed 2026-06-17Public domain