{"id":"CVE-2024-26757","aliases":["CVE-2024-26757"],"related":[],"kind":"vulnerability","state":"published","title":"md: Don't ignore read-only array in md_check_recovery()","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\nmd: Don't ignore read-only array in md_check_recovery()\n\nUsually if the array is not read-write, md_check_recovery() won't\nregister new sync_thread in the first place. And if the array is\nread-write and sync_thread is registered, md_set_readonly() will\nunregister sync_thread before setting the array read-only. md/raid\nfollow this behavior hence there is no problem.\n\nAfter commit f52f5c71f3d4 (\"md: fix stopping sync thread\"), following\nhang can be triggered by test shell/integrity-caching.sh:\n\n1) array is read-only. dm-raid update super block:\nrs_update_sbs\n ro = mddev->ro\n mddev->ro = 0\n  -> set array read-write\n md_update_sb\n\n2) register new sync thread concurrently.\n\n3) dm-raid set array back to read-only:\nrs_update_sbs\n mddev->ro = ro\n\n4) stop the array:\nraid_dtr\n md_stop\n  stop_sync_thread\n    set_bit(MD_RECOVERY_INTR, &mddev->recovery);\n    md_wakeup_thread_directly(mddev->sync_thread);\n    wait_event(..., !test_bit(MD_RECOVERY_RUNNING, &mddev->recovery))\n\n5) sync thread done:\n md_do_sync\n set_bit(MD_RECOVERY_DONE, &mddev->recovery);\n md_wakeup_thread(mddev->thread);\n\n6) daemon thread can't unregister sync thread:\n md_check_recovery\n  if (!md_is_rdwr(mddev) &&\n      !test_bit(MD_RECOVERY_NEEDED, &mddev->recovery))\n   return;\n  -> -> MD_RECOVERY_RUNNING can't be cleared, hence step 4 hang;\n\nThe root cause is that dm-raid manipulate 'mddev->ro' by itself,\nhowever, dm-raid really should stop sync thread before setting the\narray read-only. Unfortunately, I need to read more code before I\ncan refacter the handler of 'mddev->ro' in dm-raid, hence let's fix\nthe problem the easy way for now to prevent dm-raid regression.","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\nmd: Don't ignore read-only array in md_check_recovery()\n\nUsually if the array is not read-write, md_check_recovery() won't\nregister new sync_thread in the first place. And if the array is\nread-write and sync_thread is registered, md_set_readonly() will\nunregister sync_thread before setting the array read-only. md/raid\nfollow this behavior hence there is no problem.\n\nAfter commit f52f5c71f3d4 (\"md: fix stopping sync thread\"), following\nhang can be triggered by test shell/integrity-caching.sh:\n\n1) array is read-only. dm-raid update super block:\nrs_update_sbs\n ro = mddev->ro\n mddev->ro = 0\n  -> set array read-write\n md_update_sb\n\n2) register new sync thread concurrently.\n\n3) dm-raid set array back to read-only:\nrs_update_sbs\n mddev->ro = ro\n\n4) stop the array:\nraid_dtr\n md_stop\n  stop_sync_thread\n    set_bit(MD_RECOVERY_INTR, &mddev->recovery);\n    md_wakeup_thread_directly(mddev->sync_thread);\n    wait_event(..., !test_bit(MD_RECOVERY_RUNNING, &mddev->recovery))\n\n5) sync thread done:\n md_do_sync\n set_bit(MD_RECOVERY_DONE, &mddev->recovery);\n md_wakeup_thread(mddev->thread);\n\n6) daemon thread can't unregister sync thread:\n md_check_recovery\n  if (!md_is_rdwr(mddev) &&\n      !test_bit(MD_RECOVERY_NEEDED, &mddev->recovery))\n   return;\n  -> -> MD_RECOVERY_RUNNING can't be cleared, hence step 4 hang;\n\nThe root cause is that dm-raid manipulate 'mddev->ro' by itself,\nhowever, dm-raid really should stop sync thread before setting the\narray read-only. Unfortunately, I need to read more code before I\ncan refacter the handler of 'mddev->ro' in dm-raid, hence let's fix\nthe problem the easy way for now to prevent dm-raid regression.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se resolvió la siguiente vulnerabilidad: md: No ignorar la matriz de solo lectura en md_check_recovery() Generalmente, si la matriz no es de lectura y escritura, md_check_recovery() no registrará un nuevo sync_thread en primer lugar. Y si la matriz es de lectura y escritura y sync_thread está registrado, md_set_readonly() cancelará el registro de sync_thread antes de configurar la matriz como de solo lectura. md/raid sigue este comportamiento, por lo que no hay problema. Después de commit f52f5c71f3d4 (\"md: arreglar la detención del hilo de sincronización\"), el siguiente bloqueo puede activarse mediante test shell/integrity-caching.sh: 1) la matriz es de solo lectura. Superbloque de actualización dm-raid: rs_update_sbs ro = mddev-&gt;ro mddev-&gt;ro = 0 -&gt; establecer matriz de lectura y escritura md_update_sb 2) registrar un nuevo hilo de sincronización simultáneamente. 3) dm-raid vuelve a configurar la matriz en solo lectura: rs_update_sbs mddev-&gt;ro = ro 4) detiene la matriz: raid_dtr md_stop stop_sync_thread set_bit(MD_RECOVERY_INTR, &amp;mddev-&gt;recovery); md_wakeup_thread_directly(mddev-&gt;sync_thread); wait_event(..., !test_bit(MD_RECOVERY_RUNNING, &amp;mddev-&gt;recovery)) 5) hilo de sincronización realizado: md_do_sync set_bit(MD_RECOVERY_DONE, &amp;mddev-&gt;recovery); md_wakeup_thread(mddev-&gt;thread); 6) el hilo del demonio no puede cancelar el registro del hilo de sincronización: md_check_recovery if (!md_is_rdwr(mddev) &amp;&amp; !test_bit(MD_RECOVERY_NEEDED, &amp;mddev-&gt;recovery)) return; -&gt; -&gt; MD_RECOVERY_RUNNING no se puede borrar, por lo tanto el paso 4 se bloquea; La causa principal es que dm-raid manipula 'mddev-&gt;ro' por sí solo; sin embargo, dm-raid realmente debería detener el hilo de sincronización antes de configurar la matriz como de solo lectura. Desafortunadamente, necesito leer más código antes de poder refactorizar el controlador de 'mddev-&gt;ro' en dm-raid, por lo tanto, solucionemos el problema de la manera más fácil por ahora para evitar la regresión de dm-raid.","source":"nvd"}],"published":"2024-04-03T17:00:41.633Z","modified":"2026-06-17T07:18:16.047Z","severity":{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"CISA-ADP","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-404"],"affected":[{"ranges":[{"type":"git","introduced":"ecbfb9f118bce49f571675929160e4ecef91cc8a","fixed":"2ea169c5a0b1134d573d07fc27a16f327ad0e7d3","status":"affected"},{"type":"git","introduced":"ecbfb9f118bce49f571675929160e4ecef91cc8a","fixed":"55a48ad2db64737f7ffc0407634218cc6e4c513b","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"4.8","status":"affected"},{"type":"semver","introduced":"0","fixed":"4.8","status":"unaffected"},{"type":"semver","introduced":"6.7.7","lastAffected":"6.7.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.8","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","introduced":"4.8","fixed":"6.7.7"},{"status":"affected","version":"6.8"},{"status":"affected","version":"6.8"},{"status":"affected","version":"6.8"},{"status":"affected","version":"6.8"},{"status":"affected","version":"6.8"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/2ea169c5a0b1134d573d07fc27a16f327ad0e7d3","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/55a48ad2db64737f7ffc0407634218cc6e4c513b","tags":["patch","x-transferred"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","ssvc":{"scorer":"CISA-ADP","exploitation":"none","automatable":"no","technicalImpact":"partial","date":"2024-04-03T19:35:42.965Z"},"sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2024-26757","url":"https://www.cve.org/CVERecord?id=CVE-2024-26757","licence":"CVE Terms of Use","modified":"2026-05-11T20:03:35.167Z"},{"source":"nvd","name":"NVD","id":"CVE-2024-26757","url":"https://nvd.nist.gov/vuln/detail/CVE-2024-26757","licence":"Public domain","modified":"2026-06-17T07:18:16.047Z"}],"updatedAt":"2026-11-25T22:58:38.687Z","epss":{"score":0.00209,"percentile":0.11674,"date":"2026-12-01T12:00:22.000Z"}}