In the Linux kernel, the following vulnerability has been resolved:
dmaengine: fix NULL pointer in channel unregistration function
_dmaasyncdevicechannelregister() can fail. In case of failure, chan->local is freed (with freepercpu()), and chan->local is nullified. When dmaasyncdeviceunregister() is called (because of managed API or intentionally by DMA controller driver), channels are unconditionally unregistered, leading to this NULL pointer: [ 1.318693] Unable to handle kernel NULL pointer dereference at virtual address 00000000000000d0 [...] [ 1.484499] Call trace: [ 1.486930] devicedel+0x40/0x394 [ 1.490314] deviceunregister+0x20/0x7c [ 1.494220] _dmaasyncdevicechannelunregister+0x68/0xc0
Look at dmaasyncdevice_register() function error path, channel device unregistration is done only if chan->local is not NULL.
Then add the same condition at the beginning of _dmaasyncdevicechannel_unregister() function, to avoid NULL pointer issue whatever the API used to reach this function.
{ "vanir_signatures": [ { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@047fce470412ab64cb7345f9ff5d06919078ad79", "signature_type": "Line", "target": { "file": "drivers/dma/dmaengine.c" }, "id": "CVE-2023-52492-02bcce60", "digest": { "threshold": 0.9, "line_hashes": [ "221442562882822045271031072439814263587", "163047632528688364397675913899096853533", "215899577116020584336789903040375150886", "249968743533098945988395221817298595037" ] }, "deprecated": false, "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7f0ccfad2031eddcc510caf4e57f2d4aa2d8a50b", "signature_type": "Function", "target": { "file": "drivers/dma/dmaengine.c", "function": "__dma_async_device_channel_unregister" }, "id": "CVE-2023-52492-2ef6fb22", "digest": { "function_hash": "236754177403282776307103047750827726201", "length": 450.0 }, "deprecated": false, "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f5c24d94512f1b288262beda4d3dcb9629222fc7", "signature_type": "Line", "target": { "file": "drivers/dma/dmaengine.c" }, "id": "CVE-2023-52492-643ef881", "digest": { "threshold": 0.9, "line_hashes": [ "221442562882822045271031072439814263587", "163047632528688364397675913899096853533", "215899577116020584336789903040375150886", "249968743533098945988395221817298595037" ] }, "deprecated": false, "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9263fd2a63487c6d04cbb7b74a48fb12e1e352d0", "signature_type": "Line", "target": { "file": "drivers/dma/dmaengine.c" }, "id": "CVE-2023-52492-7b7d751f", "digest": { "threshold": 0.9, "line_hashes": [ "221442562882822045271031072439814263587", "163047632528688364397675913899096853533", "215899577116020584336789903040375150886", "249968743533098945988395221817298595037" ] }, "deprecated": false, "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7f0ccfad2031eddcc510caf4e57f2d4aa2d8a50b", "signature_type": "Line", "target": { "file": "drivers/dma/dmaengine.c" }, "id": "CVE-2023-52492-8d8c9b3d", "digest": { "threshold": 0.9, "line_hashes": [ "221442562882822045271031072439814263587", "163047632528688364397675913899096853533", "215899577116020584336789903040375150886", "249968743533098945988395221817298595037" ] }, "deprecated": false, "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9263fd2a63487c6d04cbb7b74a48fb12e1e352d0", "signature_type": "Function", "target": { "file": "drivers/dma/dmaengine.c", "function": "__dma_async_device_channel_unregister" }, "id": "CVE-2023-52492-96041430", "digest": { "function_hash": "236754177403282776307103047750827726201", "length": 450.0 }, "deprecated": false, "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@047fce470412ab64cb7345f9ff5d06919078ad79", "signature_type": "Function", "target": { "file": "drivers/dma/dmaengine.c", "function": "__dma_async_device_channel_unregister" }, "id": "CVE-2023-52492-aa228e6b", "digest": { "function_hash": "6307763143936340030289664296706266360", "length": 524.0 }, "deprecated": false, "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9de69732dde4e443c1c7f89acbbed2c45a6a8e17", "signature_type": "Function", "target": { "file": "drivers/dma/dmaengine.c", "function": "__dma_async_device_channel_unregister" }, "id": "CVE-2023-52492-b235cfac", "digest": { "function_hash": "6307763143936340030289664296706266360", "length": 524.0 }, "deprecated": false, "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@f5c24d94512f1b288262beda4d3dcb9629222fc7", "signature_type": "Function", "target": { "file": "drivers/dma/dmaengine.c", "function": "__dma_async_device_channel_unregister" }, "id": "CVE-2023-52492-b2ab78f2", "digest": { "function_hash": "236754177403282776307103047750827726201", "length": 450.0 }, "deprecated": false, "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@9de69732dde4e443c1c7f89acbbed2c45a6a8e17", "signature_type": "Line", "target": { "file": "drivers/dma/dmaengine.c" }, "id": "CVE-2023-52492-c3fe19a0", "digest": { "threshold": 0.9, "line_hashes": [ "221442562882822045271031072439814263587", "163047632528688364397675913899096853533", "215899577116020584336789903040375150886", "249968743533098945988395221817298595037" ] }, "deprecated": false, "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2ab32986a0b9e329eb7f8f04dd57cc127f797c08", "signature_type": "Line", "target": { "file": "drivers/dma/dmaengine.c" }, "id": "CVE-2023-52492-cb659bbf", "digest": { "threshold": 0.9, "line_hashes": [ "221442562882822045271031072439814263587", "163047632528688364397675913899096853533", "215899577116020584336789903040375150886", "249968743533098945988395221817298595037" ] }, "deprecated": false, "signature_version": "v1" }, { "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@2ab32986a0b9e329eb7f8f04dd57cc127f797c08", "signature_type": "Function", "target": { "file": "drivers/dma/dmaengine.c", "function": "__dma_async_device_channel_unregister" }, "id": "CVE-2023-52492-f75cdba8", "digest": { "function_hash": "236754177403282776307103047750827726201", "length": 450.0 }, "deprecated": false, "signature_version": "v1" } ] }