CVE-2024-38598: md: fix resync softlockup when bitmap size is less than array size
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 retfromforkasm+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 mdbitmapgetcounter"(), 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.
Other sources
In the Linux kernel, the following vulnerability has been resolved:
md: fix resync softlockup when bitmap size is less than array size
The Linux kernel CVE team has assigned CVE-2024-38598 to this issue.
Upstream advisory: https://lore.kernel.org/linux-cve-announce/2024061956-CVE-2024-38598-8629@gregkh/T
— Red Hat
Linux Kernel is vulnerable to a denial of service, caused by a flaw in Md. By sending a specially crafted request, a local authenticated attacker could exploit this vulnerability to cause a denial of service.
— IBM
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2024-38598?
CVE-2024-38598 has been classified as a serious vulnerability in the Linux kernel that can lead to system instability.
How do I fix CVE-2024-38598?
To remediate CVE-2024-38598, update the Linux kernel to versions 4.19.317, 5.4.279, 5.10.220, 5.15.162, 6.1.94, or later as recommended by your distribution.
What versions of the Linux kernel are affected by CVE-2024-38598?
CVE-2024-38598 affects multiple kernel versions including those before 4.19.316, 5.4.278, 5.10.219, 5.15.161, and 6.1.93.
Who is the vendor for the fixed versions of CVE-2024-38598?
The vendor for the fixed versions of CVE-2024-38598 is Red Hat as well as Debian for their respective kernel packages.
Are there specific configurations that expose systems to CVE-2024-38598?
Yes, using dm-raid10 while performing lvextend and lvchange with sync actions can trigger the soft lockup associated with CVE-2024-38598.