In the Linux kernel, the following vulnerability has been resolved:
md: fix resync softlockup when bitmap size is less than array size
Is is reported that for dm-raid10, lvextend + lvchange --syncaction will trigger following softlockup:
kernel:watchdog: BUG: soft lockup - CPU#3 stuck for 26s! [mdXresync:6976] CPU: 7 PID: 3588 Comm: mdXresync Kdump: loaded Not tainted 6.9.0-rc4-next-20240419 #1 RIP: 0010:rawspinunlockirq+0x13/0x30 Call Trace: <TASK> mdbitmapstartsync+0x6b/0xf0 raid10syncrequest+0x25c/0x1b40 [raid10] mddosync+0x64b/0x1020 mdthread+0xa7/0x170 kthread+0xcf/0x100 retfromfork+0x30/0x50 retfromfork_asm+0x1a/0x30
And the detailed process is as follows:
mddosync j = mddev->resyncmin while (j < maxsectors) sectors = raid10syncrequest(mddev, j, &skipped) if (!mdbitmapstartsync(..., &syncblocks)) // mdbitmapstartsync set syncblocks to 0 return syncblocks + sectorsskippe; // sectors = 0; j += sectors; // j never change
Root cause is that commit 301867b1c168 ("md/raid10: check slab-out-of-bounds in mdbitmapgetcounter") return early from mdbitmapgetcounter(), without setting returned blocks.
Fix this problem by always set returned blocks from mdbitmapget_counter"(), as it used to be.
Noted that this patch just fix the softlockup problem in kernel, the case that bitmap size doesn't match array size still need to be fixed.
{ "vanir_signatures": [ { "signature_version": "v1", "signature_type": "Line", "target": { "file": "drivers/md/md-bitmap.c" }, "deprecated": false, "digest": { "line_hashes": [ "141176963022262746502340611653009200929", "105200576838574166197902338638582019019", "1175959007492383672501500934367688568", "162655985269789197876222001552440414840", "153802067319087509225354021267542997992", "78768589994339828323647107486067701510", "192395109586838478843319459962392526987", "217355857255543769493908835514363076205", "300992965247317301774243399956625403849", "161058918020967732487809145863726418394", "78035851304250690662758283923394520444" ], "threshold": 0.9 }, "id": "CVE-2024-38598-1b678d37", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d4b9c764d48fa41caa24cfb4275f3aa9fb4bd798" }, { "signature_version": "v1", "signature_type": "Line", "target": { "file": "drivers/md/md-bitmap.c" }, "deprecated": false, "digest": { "line_hashes": [ "141176963022262746502340611653009200929", "105200576838574166197902338638582019019", "1175959007492383672501500934367688568", "162655985269789197876222001552440414840", "153802067319087509225354021267542997992", "78768589994339828323647107486067701510", "192395109586838478843319459962392526987", "217355857255543769493908835514363076205", "300992965247317301774243399956625403849", "161058918020967732487809145863726418394", "78035851304250690662758283923394520444" ], "threshold": 0.9 }, "id": "CVE-2024-38598-2fd327cf", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@69296914bfd508c85935bf5f711cad9b0fe78492" }, { "signature_version": "v1", "signature_type": "Line", "target": { "file": "drivers/md/md-bitmap.c" }, "deprecated": false, "digest": { "line_hashes": [ "141176963022262746502340611653009200929", "105200576838574166197902338638582019019", "1175959007492383672501500934367688568", "162655985269789197876222001552440414840", "153802067319087509225354021267542997992", "78768589994339828323647107486067701510", "192395109586838478843319459962392526987", "217355857255543769493908835514363076205", "300992965247317301774243399956625403849", "161058918020967732487809145863726418394", "78035851304250690662758283923394520444" ], "threshold": 0.9 }, "id": "CVE-2024-38598-35767970", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c9566b812c8f66160466cc1e29df6d3646add0b1" }, { "signature_version": "v1", "signature_type": "Line", "target": { "file": "drivers/md/md-bitmap.c" }, "deprecated": false, "digest": { "line_hashes": [ "141176963022262746502340611653009200929", "105200576838574166197902338638582019019", "1175959007492383672501500934367688568", "162655985269789197876222001552440414840", "153802067319087509225354021267542997992", "78768589994339828323647107486067701510", "192395109586838478843319459962392526987", "217355857255543769493908835514363076205", "300992965247317301774243399956625403849", "161058918020967732487809145863726418394", "78035851304250690662758283923394520444" ], "threshold": 0.9 }, "id": "CVE-2024-38598-bc812b10", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@43771597feba89a839c5f893716df88ae5c237ce" }, { "signature_version": "v1", "signature_type": "Line", "target": { "file": "drivers/md/md-bitmap.c" }, "deprecated": false, "digest": { "line_hashes": [ "141176963022262746502340611653009200929", "105200576838574166197902338638582019019", "1175959007492383672501500934367688568", "162655985269789197876222001552440414840", "153802067319087509225354021267542997992", "78768589994339828323647107486067701510", "192395109586838478843319459962392526987", "217355857255543769493908835514363076205", "300992965247317301774243399956625403849", "161058918020967732487809145863726418394", "78035851304250690662758283923394520444" ], "threshold": 0.9 }, "id": "CVE-2024-38598-faf87c7a", "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@71e8e4f288e74a896b6d9cd194f3bab12bd7a10f" } ] }