In the Linux kernel, the following vulnerability has been resolved:
cxl/port: Hold port reference until decoder release
KASAN + DEBUGKOBJECTRELEASE reports a potential use-after-free in cxldecoderrelease() where it goes to reference its parent, a cxlport, to free its id back to port->decoderida.
BUG: KASAN: use-after-free in tocxlport+0x18/0x90 [cxl_core] Read of size 8 at addr ffff888119270908 by task kworker/35:2/379
CPU: 35 PID: 379 Comm: kworker/35:2 Tainted: G OE 5.17.0-rc2+ #198 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 0.0.0 02/06/2015 Workqueue: events kobjectdelayedcleanup Call Trace: <TASK> dumpstacklvl+0x59/0x73 printaddressdescription.constprop.0+0x1f/0x150 ? tocxlport+0x18/0x90 [cxlcore] kasanreport.cold+0x83/0xdf ? tocxlport+0x18/0x90 [cxlcore] tocxlport+0x18/0x90 [cxlcore] cxldecoderrelease+0x2a/0x60 [cxlcore] devicerelease+0x5f/0x100 kobject_cleanup+0x80/0x1c0
The device core only guarantees parent lifetime until all children are unregistered. If a child needs a parent to complete its ->release() callback that child needs to hold a reference to extend the lifetime of the parent.
[
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@74be98774dfbc5b8b795db726bd772e735d2edd4",
"id": "CVE-2022-49223-0187a67f",
"deprecated": false,
"target": {
"function": "cxl_decoder_release",
"file": "drivers/cxl/core/port.c"
},
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"length": 190.0,
"function_hash": "184949549709428652182050181632607069236"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@49f2dab77a5e1354f5da6ccdc9346a8212697be2",
"id": "CVE-2022-49223-0b231784",
"deprecated": false,
"target": {
"file": "drivers/cxl/core/port.c"
},
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"99625847498769245767717041243194565912",
"180578019265865061007594361637686053136",
"305065724944873368281596826084358289888",
"168541421599142187368410167724080616843",
"256774140306661272040013417035376056186",
"93542143870594961663905837376129655592",
"339241739164872928739527557501977843369",
"53678571442987489994413230172155007517"
]
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@49f2dab77a5e1354f5da6ccdc9346a8212697be2",
"id": "CVE-2022-49223-0f508f8d",
"deprecated": false,
"target": {
"function": "cxl_decoder_release",
"file": "drivers/cxl/core/port.c"
},
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"length": 190.0,
"function_hash": "184949549709428652182050181632607069236"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b0022ca445d5fc4d0c89d15dcd0f855977b22c1d",
"id": "CVE-2022-49223-120b3aca",
"deprecated": false,
"target": {
"function": "cxl_decoder_release",
"file": "drivers/cxl/core/bus.c"
},
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"length": 190.0,
"function_hash": "184949549709428652182050181632607069236"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@518bb96367123062b48b0a9842f2864249b565f6",
"id": "CVE-2022-49223-31a358db",
"deprecated": false,
"target": {
"file": "drivers/cxl/core/bus.c"
},
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"99625847498769245767717041243194565912",
"180578019265865061007594361637686053136",
"305065724944873368281596826084358289888",
"168541421599142187368410167724080616843",
"81160888996921898208435095849106230325",
"148698539667649090167424460440779261139",
"65543983757371966789125081198656053212"
]
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b0022ca445d5fc4d0c89d15dcd0f855977b22c1d",
"id": "CVE-2022-49223-369b1f68",
"deprecated": false,
"target": {
"file": "drivers/cxl/core/bus.c"
},
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"99625847498769245767717041243194565912",
"180578019265865061007594361637686053136",
"305065724944873368281596826084358289888",
"168541421599142187368410167724080616843",
"256774140306661272040013417035376056186",
"93542143870594961663905837376129655592",
"339241739164872928739527557501977843369",
"53678571442987489994413230172155007517"
]
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@49f2dab77a5e1354f5da6ccdc9346a8212697be2",
"id": "CVE-2022-49223-38e8a6f7",
"deprecated": false,
"target": {
"function": "cxl_decoder_alloc",
"file": "drivers/cxl/core/port.c"
},
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"length": 747.0,
"function_hash": "86152051439172279896103040913885293356"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@518bb96367123062b48b0a9842f2864249b565f6",
"id": "CVE-2022-49223-551b9a07",
"deprecated": false,
"target": {
"function": "cxl_decoder_release",
"file": "drivers/cxl/core/bus.c"
},
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"length": 190.0,
"function_hash": "184949549709428652182050181632607069236"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@74be98774dfbc5b8b795db726bd772e735d2edd4",
"id": "CVE-2022-49223-688c075e",
"deprecated": false,
"target": {
"function": "cxl_decoder_alloc",
"file": "drivers/cxl/core/port.c"
},
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"length": 1019.0,
"function_hash": "217436788770895300367712696002382175954"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@74be98774dfbc5b8b795db726bd772e735d2edd4",
"id": "CVE-2022-49223-834e109b",
"deprecated": false,
"target": {
"file": "drivers/cxl/core/port.c"
},
"signature_version": "v1",
"signature_type": "Line",
"digest": {
"threshold": 0.9,
"line_hashes": [
"99625847498769245767717041243194565912",
"180578019265865061007594361637686053136",
"197107951296373861132922292001694773466",
"127904391996218628204500964301577816649",
"256774140306661272040013417035376056186",
"93542143870594961663905837376129655592",
"96242963155928287286163244561039999807",
"108880836588865442481760738081940301180"
]
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b0022ca445d5fc4d0c89d15dcd0f855977b22c1d",
"id": "CVE-2022-49223-ddc0e11c",
"deprecated": false,
"target": {
"function": "cxl_decoder_alloc",
"file": "drivers/cxl/core/bus.c"
},
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"length": 747.0,
"function_hash": "86152051439172279896103040913885293356"
}
},
{
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@518bb96367123062b48b0a9842f2864249b565f6",
"id": "CVE-2022-49223-ff49d591",
"deprecated": false,
"target": {
"function": "cxl_decoder_alloc",
"file": "drivers/cxl/core/bus.c"
},
"signature_version": "v1",
"signature_type": "Function",
"digest": {
"length": 1207.0,
"function_hash": "39518428701235621863202642317736300140"
}
}
]