In the Linux kernel, the following vulnerability has been resolved:
drm/bridge: megachips: Fix a null pointer dereference bug
When removing the module we will get the following warning:
[ 31.911505] i2c-core: driver [stdp2690-ge-b850v3-fw] unregistered [ 31.912484] general protection fault, probably for non-canonical address 0xdffffc0000000001: 0000 [#1] PREEMPT SMP KASAN PTI [ 31.913338] KASAN: null-ptr-deref in range [0x0000000000000008-0x000000000000000f] [ 31.915280] RIP: 0010:drmbridgeremove+0x97/0x130 [ 31.921825] Call Trace: [ 31.922533] stdp4028geb850v3fwremove+0x34/0x60 [megachipsstdpxxxxgeb850v3fw] [ 31.923139] i2cdeviceremove+0x181/0x1f0
The two bridges (stdp2690, stdp4028) do not probe at the same time, so the driver does not call geb850v3resgiter() when probing, causing the driver to try to remove the object that has not been initialized.
Fix this by checking whether both the bridges are probed.
{
"cna_assigner": "Linux",
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2022/50xxx/CVE-2022-50317.json"
}"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2022-50317.json"
[
{
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@21764467ab396d9f08921e0a5ffa1214244e1ad9",
"id": "CVE-2022-50317-39d691a2",
"deprecated": false,
"target": {
"file": "drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c"
},
"signature_version": "v1",
"digest": {
"line_hashes": [
"82305012381005629903580773571665447839",
"68234454741305394132672050584549530260",
"66157700986375147772958181698399984168",
"65777432928890246098522011284176435838"
],
"threshold": 0.9
}
},
{
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7371fad5cfe6eada6bb5523c895fd6074b15c2b9",
"id": "CVE-2022-50317-475d243c",
"deprecated": false,
"target": {
"function": "ge_b850v3_lvds_remove",
"file": "drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c"
},
"signature_version": "v1",
"digest": {
"length": 238.0,
"function_hash": "100842816951118120841477551472868884303"
}
},
{
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1daf69228e310938177119c4eadcd30fc75c81e0",
"id": "CVE-2022-50317-5892465e",
"deprecated": false,
"target": {
"function": "ge_b850v3_lvds_remove",
"file": "drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c"
},
"signature_version": "v1",
"digest": {
"length": 280.0,
"function_hash": "314521724695088854605637942063015626376"
}
},
{
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1ff673333d46d2c1b053ebd0c1c7c7c79e36943e",
"id": "CVE-2022-50317-7884787c",
"deprecated": false,
"target": {
"file": "drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c"
},
"signature_version": "v1",
"digest": {
"line_hashes": [
"82305012381005629903580773571665447839",
"68234454741305394132672050584549530260",
"66157700986375147772958181698399984168",
"65777432928890246098522011284176435838"
],
"threshold": 0.9
}
},
{
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1ff673333d46d2c1b053ebd0c1c7c7c79e36943e",
"id": "CVE-2022-50317-bbfee006",
"deprecated": false,
"target": {
"function": "ge_b850v3_lvds_remove",
"file": "drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c"
},
"signature_version": "v1",
"digest": {
"length": 238.0,
"function_hash": "100842816951118120841477551472868884303"
}
},
{
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@877e92e9b1bdeb580b31a46061005936be902cd4",
"id": "CVE-2022-50317-ca07a8cc",
"deprecated": false,
"target": {
"function": "ge_b850v3_lvds_remove",
"file": "drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c"
},
"signature_version": "v1",
"digest": {
"length": 238.0,
"function_hash": "100842816951118120841477551472868884303"
}
},
{
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4610e7a4111fa3f3ce27c09d6d94008c55f1cd31",
"id": "CVE-2022-50317-cacc3ee0",
"deprecated": false,
"target": {
"file": "drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c"
},
"signature_version": "v1",
"digest": {
"line_hashes": [
"82305012381005629903580773571665447839",
"68234454741305394132672050584549530260",
"66157700986375147772958181698399984168",
"65777432928890246098522011284176435838"
],
"threshold": 0.9
}
},
{
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@877e92e9b1bdeb580b31a46061005936be902cd4",
"id": "CVE-2022-50317-d32469db",
"deprecated": false,
"target": {
"file": "drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c"
},
"signature_version": "v1",
"digest": {
"line_hashes": [
"82305012381005629903580773571665447839",
"68234454741305394132672050584549530260",
"66157700986375147772958181698399984168",
"65777432928890246098522011284176435838"
],
"threshold": 0.9
}
},
{
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@4610e7a4111fa3f3ce27c09d6d94008c55f1cd31",
"id": "CVE-2022-50317-d4290a60",
"deprecated": false,
"target": {
"function": "ge_b850v3_lvds_remove",
"file": "drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c"
},
"signature_version": "v1",
"digest": {
"length": 238.0,
"function_hash": "100842816951118120841477551472868884303"
}
},
{
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@1daf69228e310938177119c4eadcd30fc75c81e0",
"id": "CVE-2022-50317-da17749b",
"deprecated": false,
"target": {
"file": "drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c"
},
"signature_version": "v1",
"digest": {
"line_hashes": [
"82305012381005629903580773571665447839",
"68234454741305394132672050584549530260",
"66157700986375147772958181698399984168",
"223913890186195603714026588252718627486"
],
"threshold": 0.9
}
},
{
"signature_type": "Line",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7371fad5cfe6eada6bb5523c895fd6074b15c2b9",
"id": "CVE-2022-50317-e5532e2d",
"deprecated": false,
"target": {
"file": "drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c"
},
"signature_version": "v1",
"digest": {
"line_hashes": [
"82305012381005629903580773571665447839",
"68234454741305394132672050584549530260",
"66157700986375147772958181698399984168",
"65777432928890246098522011284176435838"
],
"threshold": 0.9
}
},
{
"signature_type": "Function",
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@21764467ab396d9f08921e0a5ffa1214244e1ad9",
"id": "CVE-2022-50317-fc5d2770",
"deprecated": false,
"target": {
"function": "ge_b850v3_lvds_remove",
"file": "drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c"
},
"signature_version": "v1",
"digest": {
"length": 238.0,
"function_hash": "100842816951118120841477551472868884303"
}
}
]