In the Linux kernel, the following vulnerability has been resolved:
ublkdrv: fix NULL pointer dereference in ublkctrlstartrecovery()
When two UBLKCMDSTARTUSERRECOVERY commands are submitted, the first one sets 'ubq->ubqdaemon' to NULL, and the second one triggers WARN in ublkqueue_reinit() and subsequently a NULL pointer dereference issue.
Fix it by adding the check in ublkctrlstartrecovery() and return immediately in case of zero 'ub->nrqueues_ready'.
BUG: kernel NULL pointer dereference, address: 0000000000000028 RIP: 0010:ublkctrlstartrecovery.constprop.0+0x82/0x180 Call Trace: <TASK> ? _die+0x20/0x70 ? pagefaultoops+0x75/0x170 ? excpagefault+0x64/0x140 ? asmexcpagefault+0x22/0x30 ? ublkctrlstartrecovery.constprop.0+0x82/0x180 ublkctrluringcmd+0x4f7/0x6c0 ? picknexttaskidle+0x26/0x40 iouringcmd+0x9a/0x1b0 ioissuesqe+0x193/0x3f0 iowqsubmitwork+0x9b/0x390 ioworkerhandlework+0x165/0x360 iowqworker+0xcb/0x2f0 ? finishtaskswitch.isra.0+0x203/0x290 ? finishtaskswitch.isra.0+0x203/0x290 ? _pfxiowqworker+0x10/0x10 retfromfork+0x2d/0x50 ? _pfxiowqworker+0x10/0x10 retfromfork_asm+0x1a/0x30 </TASK>
[
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/block/ublk_drv.c",
"function": "ublk_ctrl_start_recovery"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@136a29d8112df4ea0a57f9602ddf3579e04089dc",
"digest": {
"length": 750.0,
"function_hash": "190790074810163811837393101043461937881"
},
"id": "CVE-2024-46735-1c2bde70"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/block/ublk_drv.c",
"function": "ublk_ctrl_start_recovery"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e58f5142f88320a5b1449f96a146f2f24615c5c7",
"digest": {
"length": 750.0,
"function_hash": "190790074810163811837393101043461937881"
},
"id": "CVE-2024-46735-1ee281a3"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "drivers/block/ublk_drv.c"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@136a29d8112df4ea0a57f9602ddf3579e04089dc",
"digest": {
"line_hashes": [
"155309856004456791719896638024108816314",
"22086877834730543830280858735737678631",
"317973001511810599460926579669774934735",
"115516234172244913931231464520469198552"
],
"threshold": 0.9
},
"id": "CVE-2024-46735-79584b49"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "drivers/block/ublk_drv.c"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7c890ef60bf417d3fe5c6f7a9f6cef0e1d77f74f",
"digest": {
"line_hashes": [
"155309856004456791719896638024108816314",
"22086877834730543830280858735737678631",
"317973001511810599460926579669774934735",
"115516234172244913931231464520469198552"
],
"threshold": 0.9
},
"id": "CVE-2024-46735-91e58768"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/block/ublk_drv.c",
"function": "ublk_ctrl_start_recovery"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ca249435893dda766f3845c15ca77ca5672022d8",
"digest": {
"length": 745.0,
"function_hash": "313714461054571074399668188099818154916"
},
"id": "CVE-2024-46735-9ce7f55d"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "drivers/block/ublk_drv.c"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ca249435893dda766f3845c15ca77ca5672022d8",
"digest": {
"line_hashes": [
"155309856004456791719896638024108816314",
"22086877834730543830280858735737678631",
"317973001511810599460926579669774934735",
"115516234172244913931231464520469198552"
],
"threshold": 0.9
},
"id": "CVE-2024-46735-c346e028"
},
{
"signature_type": "Function",
"deprecated": false,
"target": {
"file": "drivers/block/ublk_drv.c",
"function": "ublk_ctrl_start_recovery"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7c890ef60bf417d3fe5c6f7a9f6cef0e1d77f74f",
"digest": {
"length": 750.0,
"function_hash": "190790074810163811837393101043461937881"
},
"id": "CVE-2024-46735-fd6698e7"
},
{
"signature_type": "Line",
"deprecated": false,
"target": {
"file": "drivers/block/ublk_drv.c"
},
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@e58f5142f88320a5b1449f96a146f2f24615c5c7",
"digest": {
"line_hashes": [
"155309856004456791719896638024108816314",
"22086877834730543830280858735737678631",
"317973001511810599460926579669774934735",
"115516234172244913931231464520469198552"
],
"threshold": 0.9
},
"id": "CVE-2024-46735-ffbc9616"
}
]