Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2082926FA73 for ; Thu, 27 Feb 2025 20:04:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740686673; cv=none; b=aJKwbtlCNQTyFHIExgW832yeeDes/GtiQabdX4mI6ynl4ZwTHDW0nUUafR7L6N4dDfnMckWKglssRTPte0z8yDDzHnSrmVryH1GE5ejwgeU1XlmJsna2NNi98mQaFvEj82CT9X03039OYH74lfORN7ytjVdhhUTefWVijdU3IzE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740686673; c=relaxed/simple; bh=ZGXPKOTZ1D+LTfhtgZGsWkaH+8dXSqCHOjEdEpQKJVQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=SsZ+sXkbtTj1MtACsrDoAMN+I6tFoFCqBI5vkK7q+vht4axDMlJM5V9/kzsaf0gDOSa6z7UERXnAiPMExiWjkhG7/GduQaYZ/YYVfOnroVchnfbqp65vleFif1nMaRSy/faEhqxSz0ILNl+8zeCqFG7boek7Ti8AXWjyu1ZrkMQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=BlS2Tw9e; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="BlS2Tw9e" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E93A1C4CEDD; Thu, 27 Feb 2025 20:04:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740686673; bh=ZGXPKOTZ1D+LTfhtgZGsWkaH+8dXSqCHOjEdEpQKJVQ=; h=From:To:Cc:Subject:Date:Reply-to:From; b=BlS2Tw9eFw4sJcEESxR2vnjjNEPi7m1yOzgCK6tgc/s1T5+OkEnPKhxMP3yl2CDDb 6DlefRyywRgL8xaWVggRpnaLK58lmw5aFvAAIKlWp3n2uuV+bDFvlKgX3HMx38fBuh eRafoUw8hJKi99UPLneOqu7Fcq2ZNa8wnKYj1eoE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-21820: tty: xilinx_uartps: split sysrq handling Date: Thu, 27 Feb 2025 12:03:17 -0800 Message-ID: <2025022710-CVE-2025-21820-f4ab@gregkh> X-Mailer: git-send-email 2.48.1 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3373; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=ZGXPKOTZ1D+LTfhtgZGsWkaH+8dXSqCHOjEdEpQKJVQ=; b=owGbwMvMwCRo6H6F97bub03G02pJDOkHjvzjvNX3Xtp3Aee2hCN3E41Mhe7y+dm5+ikp/TjQ8 3qH/9qWjlgWBkEmBlkxRZYv23iO7q84pOhlaHsaZg4rE8gQBi5OAZhIGxfDHM5qdef3E9n2sOSv FHm1Q3gFZ/3LvQwLjtW016++z5Rw/P8USbdTzYtmM+zsBwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit 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 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-rc1 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/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