In the Linux kernel, the following vulnerability has been resolved:
ata: libata-transport: fix error handling in atatlinkadd()
In atatlinkadd(), the return value of transportadddevice() is not checked. As a result, it causes null-ptr-deref while removing the module, because transportremovedevice() is called to remove the device that was not added.
Unable to handle kernel NULL pointer dereference at virtual address 00000000000000d0 CPU: 33 PID: 13850 Comm: rmmod Kdump: loaded Tainted: G W 6.1.0-rc3+ #12 pstate: 60400009 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--) pc : devicedel+0x48/0x39c lr : devicedel+0x44/0x39c Call trace: devicedel+0x48/0x39c attributecontainerclassdevicedel+0x28/0x40 transportremoveclassdev+0x60/0x7c attributecontainerdevicetrigger+0x118/0x120 transportremovedevice+0x20/0x30 atatlinkdelete+0x88/0xb0 [libata] atatportdelete+0x2c/0x60 [libata] ataportdetach+0x148/0x1b0 [libata] atapciremoveone+0x50/0x80 [libata] ahciremove_one+0x4c/0x8c [ahci]
Fix this by checking and handling return value of transportadddevice() in atatlinkadd().
[ { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@67b219314628b90b3a314528e177335b0cd5c70b", "signature_version": "v1", "target": { "file": "drivers/ata/libata-transport.c", "function": "ata_tlink_add" }, "digest": { "length": 761.0, "function_hash": "55256617384532465405099616315929204209" }, "deprecated": false, "signature_type": "Function", "id": "CVE-2022-49824-1127f9e2" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d5234480ca822bdcf03fe4d6a590ddcb854558f7", "signature_version": "v1", "target": { "file": "drivers/ata/libata-transport.c" }, "digest": { "line_hashes": [ "94465589919163681827879688591282116392", "24361452131225175389762721991357274110", "119444322046447410326437119753935133405", "300946891709821335758930285422115683077", "64622746526677348333560790375949530472", "156723041191183260761823564152175528242", "31097563066577647776708749369988831971", "242635777629789460588628238356885319659" ], "threshold": 0.9 }, "deprecated": false, "signature_type": "Line", "id": "CVE-2022-49824-20db3d1c" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cf0816f6322c5c37ee52655f928e91ecf32da103", "signature_version": "v1", "target": { "file": "drivers/ata/libata-transport.c" }, "digest": { "line_hashes": [ "94465589919163681827879688591282116392", "24361452131225175389762721991357274110", "119444322046447410326437119753935133405", "300946891709821335758930285422115683077", "64622746526677348333560790375949530472", "156723041191183260761823564152175528242", "31097563066577647776708749369988831971", "242635777629789460588628238356885319659" ], "threshold": 0.9 }, "deprecated": false, "signature_type": "Line", "id": "CVE-2022-49824-4c82784c" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7377a14598f6b04446c54bc4a50cd249470d6c6f", "signature_version": "v1", "target": { "file": "drivers/ata/libata-transport.c" }, "digest": { "line_hashes": [ "94465589919163681827879688591282116392", "24361452131225175389762721991357274110", "119444322046447410326437119753935133405", "300946891709821335758930285422115683077", "64622746526677348333560790375949530472", "156723041191183260761823564152175528242", "31097563066577647776708749369988831971", "242635777629789460588628238356885319659" ], "threshold": 0.9 }, "deprecated": false, "signature_type": "Line", "id": "CVE-2022-49824-babc2a37" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cf0816f6322c5c37ee52655f928e91ecf32da103", "signature_version": "v1", "target": { "file": "drivers/ata/libata-transport.c", "function": "ata_tlink_add" }, "digest": { "length": 761.0, "function_hash": "55256617384532465405099616315929204209" }, "deprecated": false, "signature_type": "Function", "id": "CVE-2022-49824-bef9f4bf" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7377a14598f6b04446c54bc4a50cd249470d6c6f", "signature_version": "v1", "target": { "file": "drivers/ata/libata-transport.c", "function": "ata_tlink_add" }, "digest": { "length": 761.0, "function_hash": "55256617384532465405099616315929204209" }, "deprecated": false, "signature_type": "Function", "id": "CVE-2022-49824-cf0808e5" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@d5234480ca822bdcf03fe4d6a590ddcb854558f7", "signature_version": "v1", "target": { "file": "drivers/ata/libata-transport.c", "function": "ata_tlink_add" }, "digest": { "length": 761.0, "function_hash": "55256617384532465405099616315929204209" }, "deprecated": false, "signature_type": "Function", "id": "CVE-2022-49824-e5d2158a" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@67b219314628b90b3a314528e177335b0cd5c70b", "signature_version": "v1", "target": { "file": "drivers/ata/libata-transport.c" }, "digest": { "line_hashes": [ "94465589919163681827879688591282116392", "24361452131225175389762721991357274110", "119444322046447410326437119753935133405", "300946891709821335758930285422115683077", "64622746526677348333560790375949530472", "156723041191183260761823564152175528242", "31097563066577647776708749369988831971", "242635777629789460588628238356885319659" ], "threshold": 0.9 }, "deprecated": false, "signature_type": "Line", "id": "CVE-2022-49824-ecbcd11d" } ]