| From bippy-5f407fcff5a0 Mon Sep 17 00:00:00 2001 |
| From: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| To: <linux-cve-announce@vger.kernel.org> |
| Reply-to: <cve@kernel.org>, <linux-kernel@vger.kernel.org> |
| Subject: CVE-2025-21820: tty: xilinx_uartps: split sysrq handling |
| |
| Description |
| =========== |
| |
| In the Linux kernel, the following vulnerability has been resolved: |
| |
| tty: xilinx_uartps: split sysrq handling |
| |
| lockdep detects the following circular locking dependency: |
| |
| CPU 0 CPU 1 |
| ========================== ============================ |
| cdns_uart_isr() printk() |
| uart_port_lock(port) console_lock() |
| cdns_uart_console_write() |
| if (!port->sysrq) |
| uart_port_lock(port) |
| uart_handle_break() |
| port->sysrq = ... |
| uart_handle_sysrq_char() |
| printk() |
| console_lock() |
| |
| The fixed commit attempts to avoid this situation by only taking the |
| port lock in cdns_uart_console_write if port->sysrq unset. However, if |
| (as shown above) cdns_uart_console_write runs before port->sysrq is set, |
| then it will try to take the port lock anyway. This may result in a |
| deadlock. |
| |
| Fix this by splitting sysrq handling into two parts. We use the prepare |
| helper under the port lock and defer handling until we release the lock. |
| |
| The Linux kernel CVE team has assigned CVE-2025-21820 to this issue. |
| |
| |
| Affected and fixed versions |
| =========================== |
| |
| Issue introduced in 4.6 with commit 74ea66d4ca061a3cd4c0e924e51b60e924644852 and fixed in 5.15.179 with commit e22a97700901ba5e8bf8db68056a0d50f9440cae |
| Issue introduced in 4.6 with commit 74ea66d4ca061a3cd4c0e924e51b60e924644852 and fixed in 6.1.129 with commit de5bd24197bd9ee37ec1e379a3d882bbd15c5065 |
| Issue introduced in 4.6 with commit 74ea66d4ca061a3cd4c0e924e51b60e924644852 and fixed in 6.6.78 with commit 8ea0e7b3d7b8f2f0fc9db491ff22a0abe120801c |
| Issue introduced in 4.6 with commit 74ea66d4ca061a3cd4c0e924e51b60e924644852 and fixed in 6.12.14 with commit 9b88a7c4584ba67267a051069b8abe44fc9595b2 |
| Issue introduced in 4.6 with commit 74ea66d4ca061a3cd4c0e924e51b60e924644852 and fixed in 6.13.3 with commit 4410dba9807a17a93f649a9f5870ceaf30a675a3 |
| Issue introduced in 4.6 with commit 74ea66d4ca061a3cd4c0e924e51b60e924644852 and fixed in 6.14 with commit b06f388994500297bb91be60ffaf6825ecfd2afe |
| |
| Please see https://www.kernel.org for a full list of currently supported |
| kernel versions by the kernel community. |
| |
| Unaffected versions might change over time as fixes are backported to |
| older supported kernel versions. The official CVE entry at |
| https://cve.org/CVERecord/?id=CVE-2025-21820 |
| will be updated if fixes are backported, please check that for the most |
| up to date information about this issue. |
| |
| |
| Affected files |
| ============== |
| |
| The file(s) affected by this issue are: |
| drivers/tty/serial/xilinx_uartps.c |
| |
| |
| Mitigation |
| ========== |
| |
| The Linux kernel CVE team recommends that you update to the latest |
| stable kernel version for this, and many other bugfixes. Individual |
| changes are never tested alone, but rather are part of a larger kernel |
| release. Cherry-picking individual commits is not recommended or |
| supported by the Linux kernel community at all. If however, updating to |
| the latest release is impossible, the individual changes to resolve this |
| issue can be found at these commits: |
| https://git.kernel.org/stable/c/e22a97700901ba5e8bf8db68056a0d50f9440cae |
| https://git.kernel.org/stable/c/de5bd24197bd9ee37ec1e379a3d882bbd15c5065 |
| https://git.kernel.org/stable/c/8ea0e7b3d7b8f2f0fc9db491ff22a0abe120801c |
| https://git.kernel.org/stable/c/9b88a7c4584ba67267a051069b8abe44fc9595b2 |
| https://git.kernel.org/stable/c/4410dba9807a17a93f649a9f5870ceaf30a675a3 |
| https://git.kernel.org/stable/c/b06f388994500297bb91be60ffaf6825ecfd2afe |