In the Linux kernel, the following vulnerability has been resolved:
md/raid10: prevent soft lockup while flush writes
Currently, there is no limit for raid1/raid10 plugged bio. While flushing writes, raid1 has cond_resched() while raid10 doesn't, and too many writes can cause soft lockup.
Follow up soft lockup can be triggered easily with writeback test for raid10 with ramdisks:
watchdog: BUG: soft lockup - CPU#10 stuck for 27s! [md0raid10:1293] Call Trace: <TASK> callrcu+0x16/0x20 putobject+0x41/0x80 _deleteobject+0x50/0x90 deleteobjectfull+0x2b/0x40 kmemleakfree+0x46/0xa0 slabfreefreelisthook.constprop.0+0xed/0x1a0 kmemcachefree+0xfd/0x300 mempoolfreeslab+0x1f/0x30 mempoolfree+0x3a/0x100 biofree+0x59/0x80 bioput+0xcf/0x2c0 freer10bio+0xbf/0xf0 raidendbioio+0x78/0xb0 onewritedone+0x8a/0xa0 raid10endwriterequest+0x1b4/0x430 bioendio+0x175/0x320 brdsubmitbio+0x3b9/0x9b7 [brd] _submitbio+0x69/0xe0 submitbionoacctnocheck+0x1e6/0x5a0 submitbionoacct+0x38c/0x7e0 flushpending_writes+0xf0/0x240 raid10d+0xac/0x1ed0
Fix the problem by adding cond_resched() to raid10 like what raid1 did.
Note that unlimited plugged bio still need to be optimized, for example, in the case of lots of dirty pages writeback, this will take lots of memory and io will spend a long time in plug, hence io latency is bad.
{
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2023/53xxx/CVE-2023-53151.json",
"cna_assigner": "Linux"
}"https://storage.googleapis.com/osv-test-cve-osv-conversion/osv-output/CVE-2023-53151.json"
[
{
"deprecated": false,
"signature_type": "Function",
"digest": {
"length": 698.0,
"function_hash": "93203824008628357034615154330031326682"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1d467e10507167eb6dc2c281a87675b731955d86",
"id": "CVE-2023-53151-00b06444",
"target": {
"file": "drivers/md/raid10.c",
"function": "raid10_unplug"
}
},
{
"deprecated": false,
"signature_type": "Function",
"digest": {
"length": 836.0,
"function_hash": "263760841624298294842004553636222081814"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@634daf6b2c81015cc5e28bf694a6a94a50c641cd",
"id": "CVE-2023-53151-0aca9b97",
"target": {
"file": "drivers/md/raid10.c",
"function": "flush_pending_writes"
}
},
{
"deprecated": false,
"signature_type": "Line",
"digest": {
"line_hashes": [
"119536827458716985996891073770966410622",
"339056088604955990932675140532438346608",
"156386505470697265900473426813012667160",
"180172974480789719899155634949807757317",
"119536827458716985996891073770966410622",
"339056088604955990932675140532438346608",
"303703333747273312792005637475573051354",
"62753313335611906719732277205108145644"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@010444623e7f4da6b4a4dd603a7da7469981e293",
"id": "CVE-2023-53151-0ee85c84",
"target": {
"file": "drivers/md/raid10.c"
}
},
{
"deprecated": false,
"signature_type": "Function",
"digest": {
"length": 510.0,
"function_hash": "285499964244725746437303006610223991624"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fbf50184190d55f8717bd29aa9530c399be96f30",
"id": "CVE-2023-53151-2241acd0",
"target": {
"file": "drivers/md/raid10.c",
"function": "flush_pending_writes"
}
},
{
"deprecated": false,
"signature_type": "Line",
"digest": {
"line_hashes": [
"119536827458716985996891073770966410622",
"339056088604955990932675140532438346608",
"156386505470697265900473426813012667160",
"180172974480789719899155634949807757317",
"119536827458716985996891073770966410622",
"339056088604955990932675140532438346608",
"303703333747273312792005637475573051354",
"62753313335611906719732277205108145644"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@84a578961b2566e475bfa8740beaf0abcc781a6f",
"id": "CVE-2023-53151-22615226",
"target": {
"file": "drivers/md/raid10.c"
}
},
{
"deprecated": false,
"signature_type": "Function",
"digest": {
"length": 698.0,
"function_hash": "93203824008628357034615154330031326682"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fbf50184190d55f8717bd29aa9530c399be96f30",
"id": "CVE-2023-53151-2358b2d7",
"target": {
"file": "drivers/md/raid10.c",
"function": "raid10_unplug"
}
},
{
"deprecated": false,
"signature_type": "Function",
"digest": {
"length": 836.0,
"function_hash": "263760841624298294842004553636222081814"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d0345f7c7dbc5d42e4e6f1db99c1c1879d7b0eb5",
"id": "CVE-2023-53151-3a9b4029",
"target": {
"file": "drivers/md/raid10.c",
"function": "flush_pending_writes"
}
},
{
"deprecated": false,
"signature_type": "Function",
"digest": {
"length": 1043.0,
"function_hash": "278350584291478439641978544428241759749"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f45b2fa7678ab385299de345f7e85d05caea386b",
"id": "CVE-2023-53151-567bce7a",
"target": {
"file": "drivers/md/raid10.c",
"function": "raid10_unplug"
}
},
{
"deprecated": false,
"signature_type": "Function",
"digest": {
"length": 836.0,
"function_hash": "263760841624298294842004553636222081814"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@00ecb6fa67c0f772290c5ea5ae8b46eefd503b83",
"id": "CVE-2023-53151-78607495",
"target": {
"file": "drivers/md/raid10.c",
"function": "flush_pending_writes"
}
},
{
"deprecated": false,
"signature_type": "Function",
"digest": {
"length": 1043.0,
"function_hash": "278350584291478439641978544428241759749"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@00ecb6fa67c0f772290c5ea5ae8b46eefd503b83",
"id": "CVE-2023-53151-7e698a6a",
"target": {
"file": "drivers/md/raid10.c",
"function": "raid10_unplug"
}
},
{
"deprecated": false,
"signature_type": "Function",
"digest": {
"length": 1043.0,
"function_hash": "278350584291478439641978544428241759749"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@634daf6b2c81015cc5e28bf694a6a94a50c641cd",
"id": "CVE-2023-53151-87e429f4",
"target": {
"file": "drivers/md/raid10.c",
"function": "raid10_unplug"
}
},
{
"deprecated": false,
"signature_type": "Function",
"digest": {
"length": 847.0,
"function_hash": "85553189328807482550499929313517305509"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@84a578961b2566e475bfa8740beaf0abcc781a6f",
"id": "CVE-2023-53151-8d3d6392",
"target": {
"file": "drivers/md/raid10.c",
"function": "flush_pending_writes"
}
},
{
"deprecated": false,
"signature_type": "Line",
"digest": {
"line_hashes": [
"47656527230750693935608252320514210404",
"266618523874661622946422331103289030012",
"263388780870326483402716024359929114184",
"180172974480789719899155634949807757317",
"47656527230750693935608252320514210404",
"266618523874661622946422331103289030012",
"22971946294681657214022643829202005066",
"62753313335611906719732277205108145644"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d0345f7c7dbc5d42e4e6f1db99c1c1879d7b0eb5",
"id": "CVE-2023-53151-8dc17dd8",
"target": {
"file": "drivers/md/raid10.c"
}
},
{
"deprecated": false,
"signature_type": "Line",
"digest": {
"line_hashes": [
"47656527230750693935608252320514210404",
"266618523874661622946422331103289030012",
"263388780870326483402716024359929114184",
"180172974480789719899155634949807757317",
"47656527230750693935608252320514210404",
"266618523874661622946422331103289030012",
"22971946294681657214022643829202005066",
"62753313335611906719732277205108145644"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@00ecb6fa67c0f772290c5ea5ae8b46eefd503b83",
"id": "CVE-2023-53151-9139ec37",
"target": {
"file": "drivers/md/raid10.c"
}
},
{
"deprecated": false,
"signature_type": "Line",
"digest": {
"line_hashes": [
"128445750710153661134593655523139247786",
"290563900135283424906799761113578670742",
"331037566634741321220989939188426786348",
"180172974480789719899155634949807757317",
"128445750710153661134593655523139247786",
"290563900135283424906799761113578670742",
"217134766740862327781160656271499526509",
"62753313335611906719732277205108145644"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1d467e10507167eb6dc2c281a87675b731955d86",
"id": "CVE-2023-53151-95180a7b",
"target": {
"file": "drivers/md/raid10.c"
}
},
{
"deprecated": false,
"signature_type": "Function",
"digest": {
"length": 808.0,
"function_hash": "67214549547458378659335185200957469021"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f45b2fa7678ab385299de345f7e85d05caea386b",
"id": "CVE-2023-53151-996043f5",
"target": {
"file": "drivers/md/raid10.c",
"function": "flush_pending_writes"
}
},
{
"deprecated": false,
"signature_type": "Line",
"digest": {
"line_hashes": [
"128445750710153661134593655523139247786",
"290563900135283424906799761113578670742",
"331037566634741321220989939188426786348",
"180172974480789719899155634949807757317",
"128445750710153661134593655523139247786",
"290563900135283424906799761113578670742",
"217134766740862327781160656271499526509",
"62753313335611906719732277205108145644"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fbf50184190d55f8717bd29aa9530c399be96f30",
"id": "CVE-2023-53151-a53044e9",
"target": {
"file": "drivers/md/raid10.c"
}
},
{
"deprecated": false,
"signature_type": "Function",
"digest": {
"length": 798.0,
"function_hash": "217416523355339874103834563364028806185"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@010444623e7f4da6b4a4dd603a7da7469981e293",
"id": "CVE-2023-53151-aad088ee",
"target": {
"file": "drivers/md/raid10.c",
"function": "flush_pending_writes"
}
},
{
"deprecated": false,
"signature_type": "Function",
"digest": {
"length": 1043.0,
"function_hash": "278350584291478439641978544428241759749"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d0345f7c7dbc5d42e4e6f1db99c1c1879d7b0eb5",
"id": "CVE-2023-53151-c93fc480",
"target": {
"file": "drivers/md/raid10.c",
"function": "raid10_unplug"
}
},
{
"deprecated": false,
"signature_type": "Line",
"digest": {
"line_hashes": [
"119536827458716985996891073770966410622",
"339056088604955990932675140532438346608",
"156386505470697265900473426813012667160",
"180172974480789719899155634949807757317",
"119536827458716985996891073770966410622",
"339056088604955990932675140532438346608",
"303703333747273312792005637475573051354",
"62753313335611906719732277205108145644"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@634daf6b2c81015cc5e28bf694a6a94a50c641cd",
"id": "CVE-2023-53151-dbd96f10",
"target": {
"file": "drivers/md/raid10.c"
}
},
{
"deprecated": false,
"signature_type": "Function",
"digest": {
"length": 986.0,
"function_hash": "191071449106471631335279761281210942659"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@010444623e7f4da6b4a4dd603a7da7469981e293",
"id": "CVE-2023-53151-ec90a6d5",
"target": {
"file": "drivers/md/raid10.c",
"function": "raid10_unplug"
}
},
{
"deprecated": false,
"signature_type": "Function",
"digest": {
"length": 510.0,
"function_hash": "285499964244725746437303006610223991624"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1d467e10507167eb6dc2c281a87675b731955d86",
"id": "CVE-2023-53151-ef5efe38",
"target": {
"file": "drivers/md/raid10.c",
"function": "flush_pending_writes"
}
},
{
"deprecated": false,
"signature_type": "Line",
"digest": {
"line_hashes": [
"47656527230750693935608252320514210404",
"266618523874661622946422331103289030012",
"263388780870326483402716024359929114184",
"180172974480789719899155634949807757317",
"47656527230750693935608252320514210404",
"266618523874661622946422331103289030012",
"22971946294681657214022643829202005066",
"62753313335611906719732277205108145644"
],
"threshold": 0.9
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f45b2fa7678ab385299de345f7e85d05caea386b",
"id": "CVE-2023-53151-f8dcec4d",
"target": {
"file": "drivers/md/raid10.c"
}
},
{
"deprecated": false,
"signature_type": "Function",
"digest": {
"length": 1054.0,
"function_hash": "152409502930790427825161694924822356290"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@84a578961b2566e475bfa8740beaf0abcc781a6f",
"id": "CVE-2023-53151-fb4264fe",
"target": {
"file": "drivers/md/raid10.c",
"function": "raid10_unplug"
}
}
]