In the Linux kernel, the following vulnerability has been resolved:
tty: serial: qcom-geni-serial: fix slab-out-of-bounds on RX FIFO buffer
Driver's probe allocates memory for RX FIFO (port->rxfifo) based on default RX FIFO depth, e.g. 16. Later during serial startup the qcomgeniserialportsetup() updates the RX FIFO depth (port->rxfifo_depth) to match real device capabilities, e.g. to 32.
The RX UART handle code will read "port->rxfifodepth" number of words into "port->rx_fifo" buffer, thus exceeding the bounds. This can be observed in certain configurations with Qualcomm Bluetooth HCI UART device and KASAN:
Bluetooth: hci0: QCA Product ID :0x00000010 Bluetooth: hci0: QCA SOC Version :0x400a0200 Bluetooth: hci0: QCA ROM Version :0x00000200 Bluetooth: hci0: QCA Patch Version:0x00000d2b Bluetooth: hci0: QCA controller version 0x02000200 Bluetooth: hci0: QCA Downloading qca/htbtfw20.tlv bluetooth hci0: Direct firmware load for qca/htbtfw20.tlv failed with error -2 Bluetooth: hci0: QCA Failed to request file: qca/htbtfw20.tlv (-2) Bluetooth: hci0: QCA Failed to download patch (-2) ================================================================== BUG: KASAN: slab-out-of-bounds in handlerxuart+0xa8/0x18c Write of size 4 at addr ffff279347d578c0 by task swapper/0/0
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 6.1.0-rt5-00350-gb2450b7e00be-dirty #26 Hardware name: Qualcomm Technologies, Inc. Robotics RB5 (DT) Call trace: dumpbacktrace.part.0+0xe0/0xf0 showstack+0x18/0x40 dumpstacklvl+0x8c/0xb8 printreport+0x188/0x488 kasanreport+0xb4/0x100 _asanstore4+0x80/0xa4 handlerxuart+0xa8/0x18c qcomgeniserialhandlerx+0x84/0x9c qcomgeniserialisr+0x24c/0x760 _handleirqeventpercpu+0x108/0x500 handleirqevent+0x6c/0x110 handlefasteoiirq+0x138/0x2cc generichandledomainirq+0x48/0x64
If the RX FIFO depth changes after probe, be sure to resize the buffer.
{ "vanir_signatures": [ { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fd524ca7fe45b8a06dca2dd546d62684a9768f95", "target": { "file": "drivers/tty/serial/qcom_geni_serial.c", "function": "get_tx_fifo_size" }, "id": "CVE-2022-48871-2259fbbe", "digest": { "length": 330.0, "function_hash": "305585877774668691117593216647265266616" }, "signature_version": "v1" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@894681682dbefdad917b88f86cde1069140a047a", "target": { "file": "drivers/tty/serial/qcom_geni_serial.c", "function": "get_tx_fifo_size" }, "id": "CVE-2022-48871-269b8300", "digest": { "length": 330.0, "function_hash": "305585877774668691117593216647265266616" }, "signature_version": "v1" }, { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fd524ca7fe45b8a06dca2dd546d62684a9768f95", "target": { "file": "drivers/tty/serial/qcom_geni_serial.c" }, "id": "CVE-2022-48871-2c0fa343", "digest": { "line_hashes": [ "236834734333834283689574037273837108244", "180936648766664018920723353304329730357", "278772162823895019490610030443248210672", "301989617982826113868158495913726815647", "217263616690670670480962855453353902751", "10779121583714324314904463487158714357", "251166071809863722792404077904989465800", "204672905421808818665049131733887179356", "2638034968277745619855981627139975654", "263569828809035610953659143720347736579", "53580244670639378819065682613791892448", "35035079818983291881173074191679454745", "215669652815894330615866576602417724776", "329632607124222367578589970525805877514", "5058216810648193317591333956802380854", "154528486939400594359141792389547533814", "3215150745624212610622443177457928810", "83840798300860499350980764440647929851" ], "threshold": 0.9 }, "signature_version": "v1" }, { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cb53a3366eb28fed67850c80afa52075bb71a38a", "target": { "file": "drivers/tty/serial/qcom_geni_serial.c" }, "id": "CVE-2022-48871-308c4442", "digest": { "line_hashes": [ "236834734333834283689574037273837108244", "180936648766664018920723353304329730357", "278772162823895019490610030443248210672", "301989617982826113868158495913726815647", "217263616690670670480962855453353902751", "10779121583714324314904463487158714357", "251166071809863722792404077904989465800", "204672905421808818665049131733887179356", "2638034968277745619855981627139975654", "263569828809035610953659143720347736579", "53580244670639378819065682613791892448", "35035079818983291881173074191679454745", "215669652815894330615866576602417724776", "329632607124222367578589970525805877514", "5058216810648193317591333956802380854", "154528486939400594359141792389547533814", "3215150745624212610622443177457928810", "83840798300860499350980764440647929851" ], "threshold": 0.9 }, "signature_version": "v1" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cb53a3366eb28fed67850c80afa52075bb71a38a", "target": { "file": "drivers/tty/serial/qcom_geni_serial.c", "function": "get_tx_fifo_size" }, "id": "CVE-2022-48871-3a78c2f6", "digest": { "length": 330.0, "function_hash": "305585877774668691117593216647265266616" }, "signature_version": "v1" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@894681682dbefdad917b88f86cde1069140a047a", "target": { "file": "drivers/tty/serial/qcom_geni_serial.c", "function": "qcom_geni_serial_port_setup" }, "id": "CVE-2022-48871-75f5c643", "digest": { "length": 1058.0, "function_hash": "26721594248102303666507794623476906034" }, "signature_version": "v1" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@cb53a3366eb28fed67850c80afa52075bb71a38a", "target": { "file": "drivers/tty/serial/qcom_geni_serial.c", "function": "qcom_geni_serial_port_setup" }, "id": "CVE-2022-48871-84505855", "digest": { "length": 1058.0, "function_hash": "26721594248102303666507794623476906034" }, "signature_version": "v1" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b8caf69a6946e18ffebad49847e258f5b6d52ac2", "target": { "file": "drivers/tty/serial/qcom_geni_serial.c", "function": "get_tx_fifo_size" }, "id": "CVE-2022-48871-930df810", "digest": { "length": 330.0, "function_hash": "305585877774668691117593216647265266616" }, "signature_version": "v1" }, { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b8caf69a6946e18ffebad49847e258f5b6d52ac2", "target": { "file": "drivers/tty/serial/qcom_geni_serial.c" }, "id": "CVE-2022-48871-9a8afe99", "digest": { "line_hashes": [ "236834734333834283689574037273837108244", "180936648766664018920723353304329730357", "278772162823895019490610030443248210672", "301989617982826113868158495913726815647", "217263616690670670480962855453353902751", "10779121583714324314904463487158714357", "251166071809863722792404077904989465800", "204672905421808818665049131733887179356", "2638034968277745619855981627139975654", "263569828809035610953659143720347736579", "53580244670639378819065682613791892448", "35035079818983291881173074191679454745", "215669652815894330615866576602417724776", "329632607124222367578589970525805877514", "5058216810648193317591333956802380854", "154528486939400594359141792389547533814", "3215150745624212610622443177457928810", "83840798300860499350980764440647929851" ], "threshold": 0.9 }, "signature_version": "v1" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@b8caf69a6946e18ffebad49847e258f5b6d52ac2", "target": { "file": "drivers/tty/serial/qcom_geni_serial.c", "function": "qcom_geni_serial_port_setup" }, "id": "CVE-2022-48871-ca589e8c", "digest": { "length": 1079.0, "function_hash": "107820405728749255118541045165019522647" }, "signature_version": "v1" }, { "signature_type": "Function", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@fd524ca7fe45b8a06dca2dd546d62684a9768f95", "target": { "file": "drivers/tty/serial/qcom_geni_serial.c", "function": "qcom_geni_serial_port_setup" }, "id": "CVE-2022-48871-cab31910", "digest": { "length": 1058.0, "function_hash": "26721594248102303666507794623476906034" }, "signature_version": "v1" }, { "signature_type": "Line", "deprecated": false, "source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@894681682dbefdad917b88f86cde1069140a047a", "target": { "file": "drivers/tty/serial/qcom_geni_serial.c" }, "id": "CVE-2022-48871-fe9960a2", "digest": { "line_hashes": [ "80358220202050186146882416787160706991", "180936648766664018920723353304329730357", "278772162823895019490610030443248210672", "301989617982826113868158495913726815647", "217263616690670670480962855453353902751", "10779121583714324314904463487158714357", "251166071809863722792404077904989465800", "204672905421808818665049131733887179356", "2638034968277745619855981627139975654", "263569828809035610953659143720347736579", "53580244670639378819065682613791892448", "35035079818983291881173074191679454745", "215669652815894330615866576602417724776", "329632607124222367578589970525805877514", "5058216810648193317591333956802380854", "154528486939400594359141792389547533814", "3215150745624212610622443177457928810", "83840798300860499350980764440647929851" ], "threshold": 0.9 }, "signature_version": "v1" } ] }