In the Linux kernel, the following vulnerability has been resolved:
net: qrtr: Fix an uninit variable access bug in qrtrtxresume()
Syzbot reported a bug as following:
===================================================== BUG: KMSAN: uninit-value in qrtrtxresume+0x185/0x1f0 net/qrtr/afqrtr.c:230 qrtrtxresume+0x185/0x1f0 net/qrtr/afqrtr.c:230 qrtrendpointpost+0xf85/0x11b0 net/qrtr/afqrtr.c:519 qrtrtunwriteiter+0x270/0x400 net/qrtr/tun.c:108 callwriteiter include/linux/fs.h:2189 [inline] aiowrite+0x63a/0x950 fs/aio.c:1600 iosubmitone+0x1d1c/0x3bf0 fs/aio.c:2019 _dosysiosubmit fs/aio.c:2078 [inline] _sesysiosubmit+0x293/0x770 fs/aio.c:2048 _x64sysiosubmit+0x92/0xd0 fs/aio.c:2048 dosyscallx64 arch/x86/entry/common.c:50 [inline] dosyscall64+0x3d/0xb0 arch/x86/entry/common.c:80 entrySYSCALL64after_hwframe+0x63/0xcd
Uninit was created at: slabpostallochook mm/slab.h:766 [inline] slaballocnode mm/slub.c:3452 [inline] _kmemcacheallocnode+0x71f/0xce0 mm/slub.c:3491 _dokmallocnode mm/slabcommon.c:967 [inline] _kmallocnodetrackcaller+0x114/0x3b0 mm/slabcommon.c:988 kmallocreserve net/core/skbuff.c:492 [inline] _allocskb+0x3af/0x8f0 net/core/skbuff.c:565 _netdevallocskb+0x120/0x7d0 net/core/skbuff.c:630 qrtrendpointpost+0xbd/0x11b0 net/qrtr/afqrtr.c:446 qrtrtunwriteiter+0x270/0x400 net/qrtr/tun.c:108 callwriteiter include/linux/fs.h:2189 [inline] aiowrite+0x63a/0x950 fs/aio.c:1600 iosubmitone+0x1d1c/0x3bf0 fs/aio.c:2019 _dosysiosubmit fs/aio.c:2078 [inline] _sesysiosubmit+0x293/0x770 fs/aio.c:2048 _x64sysiosubmit+0x92/0xd0 fs/aio.c:2048 dosyscallx64 arch/x86/entry/common.c:50 [inline] dosyscall64+0x3d/0xb0 arch/x86/entry/common.c:80 entrySYSCALL64after_hwframe+0x63/0xcd
It is because that skb->len requires at least sizeof(struct qrtrctrlpkt) in qrtrtxresume(). And skb->len equals to size in qrtrendpointpost(). But size is less than sizeof(struct qrtrctrlpkt) when qrtrcb->type equals to QRTRTYPERESUMETX in qrtrendpointpost() under the syzbot scenario. This triggers the uninit variable access bug.
Add size check when qrtrcb->type equals to QRTRTYPERESUMETX in qrtrendpointpost() to fix the bug.
[
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8c9ce34a6ff2c544f96ce0b088e8fd3c1b9698c4",
"deprecated": false,
"id": "CVE-2023-53578-1a46d816",
"target": {
"file": "net/qrtr/af_qrtr.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"102017536302687239516942872313364109659",
"281930456347399941230695306966175640170",
"121265641376155204794554109821516288535",
"125035390127743842516621194992593110181",
"201042307105419619384850574057340366563",
"88967040696505060210165409828554182326",
"122602269252764039000815675782139961394",
"12799334062221854436555142093604229233"
]
},
"signature_type": "Line"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bef57c227b52c2bde00fad33556175d36d12cfa0",
"deprecated": false,
"id": "CVE-2023-53578-202a0092",
"target": {
"file": "net/qrtr/af_qrtr.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"102017536302687239516942872313364109659",
"281930456347399941230695306966175640170",
"121265641376155204794554109821516288535",
"125035390127743842516621194992593110181",
"201042307105419619384850574057340366563",
"88967040696505060210165409828554182326",
"122602269252764039000815675782139961394",
"12799334062221854436555142093604229233"
]
},
"signature_type": "Line"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6417070918de3bcdbe0646e7256dae58fd8083ba",
"deprecated": false,
"id": "CVE-2023-53578-3ab00b61",
"target": {
"function": "qrtr_endpoint_post",
"file": "net/qrtr/af_qrtr.c"
},
"digest": {
"length": 2325.0,
"function_hash": "152127932278963965638706082932744848423"
},
"signature_type": "Function"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3814d211ff13ee35f2d9437439a6c7df58524137",
"deprecated": false,
"id": "CVE-2023-53578-6237a132",
"target": {
"function": "qrtr_endpoint_post",
"file": "net/qrtr/af_qrtr.c"
},
"digest": {
"length": 2143.0,
"function_hash": "250812352048953775105146223444681007311"
},
"signature_type": "Function"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3814d211ff13ee35f2d9437439a6c7df58524137",
"deprecated": false,
"id": "CVE-2023-53578-8215a14b",
"target": {
"file": "net/qrtr/af_qrtr.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"102017536302687239516942872313364109659",
"281930456347399941230695306966175640170",
"121265641376155204794554109821516288535",
"119711647588367915759235517546030897261",
"117052178944539798163756006594805099495",
"74787600455530555622918714081674849992"
]
},
"signature_type": "Line"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@6417070918de3bcdbe0646e7256dae58fd8083ba",
"deprecated": false,
"id": "CVE-2023-53578-93ae2430",
"target": {
"file": "net/qrtr/af_qrtr.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"102017536302687239516942872313364109659",
"281930456347399941230695306966175640170",
"121265641376155204794554109821516288535",
"125035390127743842516621194992593110181",
"201042307105419619384850574057340366563",
"88967040696505060210165409828554182326",
"122602269252764039000815675782139961394",
"12799334062221854436555142093604229233"
]
},
"signature_type": "Line"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c6a796ee5a639ffb83c6e5469408cc2ec16cac6a",
"deprecated": false,
"id": "CVE-2023-53578-ca0d9920",
"target": {
"file": "net/qrtr/af_qrtr.c"
},
"digest": {
"threshold": 0.9,
"line_hashes": [
"102017536302687239516942872313364109659",
"281930456347399941230695306966175640170",
"121265641376155204794554109821516288535",
"125035390127743842516621194992593110181",
"201042307105419619384850574057340366563",
"88967040696505060210165409828554182326",
"122602269252764039000815675782139961394",
"12799334062221854436555142093604229233"
]
},
"signature_type": "Line"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@bef57c227b52c2bde00fad33556175d36d12cfa0",
"deprecated": false,
"id": "CVE-2023-53578-ea9c10e6",
"target": {
"function": "qrtr_endpoint_post",
"file": "net/qrtr/af_qrtr.c"
},
"digest": {
"length": 2325.0,
"function_hash": "152127932278963965638706082932744848423"
},
"signature_type": "Function"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c6a796ee5a639ffb83c6e5469408cc2ec16cac6a",
"deprecated": false,
"id": "CVE-2023-53578-fabf43a8",
"target": {
"function": "qrtr_endpoint_post",
"file": "net/qrtr/af_qrtr.c"
},
"digest": {
"length": 2325.0,
"function_hash": "152127932278963965638706082932744848423"
},
"signature_type": "Function"
},
{
"signature_version": "v1",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8c9ce34a6ff2c544f96ce0b088e8fd3c1b9698c4",
"deprecated": false,
"id": "CVE-2023-53578-fdec6bda",
"target": {
"function": "qrtr_endpoint_post",
"file": "net/qrtr/af_qrtr.c"
},
"digest": {
"length": 2325.0,
"function_hash": "152127932278963965638706082932744848423"
},
"signature_type": "Function"
}
]