In the Linux kernel, the following vulnerability has been resolved:
md: Don't ignore suspended array in mdcheckrecovery()
mddevsuspend() never stop syncthread, hence it doesn't make sense to ignore suspended array in mdcheckrecovery(), which might cause sync_thread can't be unregistered.
After commit f52f5c71f3d4 ("md: fix stopping sync thread"), following hang can be triggered by test shell/integrity-caching.sh:
1) suspend the array: raidpostsuspend mddevsuspend
2) stop the array: raiddtr mdstop _mdstopwrites stopsyncthread setbit(MDRECOVERYINTR, &mddev->recovery); mdwakeupthreaddirectly(mddev->syncthread); waitevent(..., !testbit(MDRECOVERYRUNNING, &mddev->recovery))
3) sync thread done: mddosync setbit(MDRECOVERYDONE, &mddev->recovery); mdwakeup_thread(mddev->thread);
4) daemon thread can't unregister sync thread: mdcheckrecovery if (mddev->suspended) return; -> return directly mdreadsyncthread clearbit(MDRECOVERYRUNNING, &mddev->recovery); -> MDRECOVERYRUNNING can't be cleared, hence step 2 hang;
This problem is not just related to dm-raid, fix it by ignoring suspended array in mdcheckrecovery(). And follow up patches will improve dm-raid better to frozen sync thread during suspend.
[
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"52909892770122297457967525804956428386",
"194337953856093989126597732131151030632",
"48474974184394013578760738080208503631",
"196317744678128568195581183804055382291",
"148277390115134358191260227029897976310"
]
},
"target": {
"file": "drivers/md/md.c"
},
"signature_version": "v1",
"id": "CVE-2024-26758-36ab4db7",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a55f0d6179a19c6b982e2dc344d58c98647a3be0"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "293681076748288761785088850273900694228",
"length": 2884.0
},
"target": {
"file": "drivers/md/md.c",
"function": "md_check_recovery"
},
"signature_version": "v1",
"id": "CVE-2024-26758-6c0d6c43",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1baae052cccd08daf9a9d64c3f959d8cdb689757"
},
{
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"52909892770122297457967525804956428386",
"194337953856093989126597732131151030632",
"48474974184394013578760738080208503631",
"196317744678128568195581183804055382291",
"148277390115134358191260227029897976310"
]
},
"target": {
"file": "drivers/md/md.c"
},
"signature_version": "v1",
"id": "CVE-2024-26758-a763bd19",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1baae052cccd08daf9a9d64c3f959d8cdb689757"
},
{
"signature_type": "Function",
"digest": {
"function_hash": "293681076748288761785088850273900694228",
"length": 2884.0
},
"target": {
"file": "drivers/md/md.c",
"function": "md_check_recovery"
},
"signature_version": "v1",
"id": "CVE-2024-26758-bbc859b7",
"deprecated": false,
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@a55f0d6179a19c6b982e2dc344d58c98647a3be0"
}
]