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 618961D5CD7 for ; Thu, 1 May 2025 14:16:16 +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=1746108976; cv=none; b=ZwMCxjJ79gEQGdgepWe9ZAWcpATQBPBmdjYvWTINiXk7IBKN3lqBHYb4X7EV+FY7m8tagWhKA4YtkeIaUXY17PNmLn+2NEGlKCa62AIn/2ABm6wS8RGmZaljJpQ+MAneByLpnKEwmuGYWdvgvvcN7E06HUR156AqZDkQVpVl3Y8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746108976; c=relaxed/simple; bh=RVrpElyWIan+4Nk2m6o6/CE+GLDVP6zh+gQLGKslPNk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=m6EDYgrLsTPUMzvRtlZj//A1T6Z2fw0YmeTciYIaF7TjbJYYMGOYyg3srP2o3hPBC8FjST8bHn5tVy8EjdIXq7DWcHUQiCvrJFbwQp+2d/l1YOYPxouangmmMuiYU6cElGZcdcF8kc8jm/MwW4Hh2aldGPvS/vJRBaWF+NCnxVM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Uqg56Jc9; 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="Uqg56Jc9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4F4EC4CEE3; Thu, 1 May 2025 14:16:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746108976; bh=RVrpElyWIan+4Nk2m6o6/CE+GLDVP6zh+gQLGKslPNk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Uqg56Jc9Yhnq8j70eGMuAe+DThjxrgd3AztVbMsGGUEp11dvniOzcuz68vSPwse87 5CtDK5yjGGCpKgFR/pCye0SKYrRG1SuP5B8QBa1aq/KwS18HDt6yC2+aPFe1+E25IK BeQm8AoTVe2dNLmP0WFjE7wIrAwLRlgNThLDad/I= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49841: serial: imx: Add missing .thaw_noirq hook Date: Thu, 1 May 2025 16:10:31 +0200 Message-ID: <2025050140-CVE-2022-49841-8d40@gregkh> X-Mailer: git-send-email 2.49.0 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=4751; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=j9MtEeNKLVizkXS2i9Ps6cdZSREVC7KCX9jVGzAZJH0=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCDUss27r2/7onkda5vVKKe5r16t4Z8zX2pp0+4CSyo VWwOWhhRywLgyATg6yYIsuXbTxH91ccUvQytD0NM4eVCWQIAxenAExkUTLDgst3rB/HTDh0+sZx rX9Whl0dvFc9Chnme+hoJN5idgjdnV/yKSqfP3j1rGBzAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: serial: imx: Add missing .thaw_noirq hook The following warning is seen with non-console UART instance when system hibernates. [ 37.371969] ------------[ cut here ]------------ [ 37.376599] uart3_root_clk already disabled [ 37.380810] WARNING: CPU: 0 PID: 296 at drivers/clk/clk.c:952 clk_core_disable+0xa4/0xb0 ... [ 37.506986] Call trace: [ 37.509432] clk_core_disable+0xa4/0xb0 [ 37.513270] clk_disable+0x34/0x50 [ 37.516672] imx_uart_thaw+0x38/0x5c [ 37.520250] platform_pm_thaw+0x30/0x6c [ 37.524089] dpm_run_callback.constprop.0+0x3c/0xd4 [ 37.528972] device_resume+0x7c/0x160 [ 37.532633] dpm_resume+0xe8/0x230 [ 37.536036] hibernation_snapshot+0x288/0x430 [ 37.540397] hibernate+0x10c/0x2e0 [ 37.543798] state_store+0xc4/0xd0 [ 37.547203] kobj_attr_store+0x1c/0x30 [ 37.550953] sysfs_kf_write+0x48/0x60 [ 37.554619] kernfs_fop_write_iter+0x118/0x1ac [ 37.559063] new_sync_write+0xe8/0x184 [ 37.562812] vfs_write+0x230/0x290 [ 37.566214] ksys_write+0x68/0xf4 [ 37.569529] __arm64_sys_write+0x20/0x2c [ 37.573452] invoke_syscall.constprop.0+0x50/0xf0 [ 37.578156] do_el0_svc+0x11c/0x150 [ 37.581648] el0_svc+0x30/0x140 [ 37.584792] el0t_64_sync_handler+0xe8/0xf0 [ 37.588976] el0t_64_sync+0x1a0/0x1a4 [ 37.592639] ---[ end trace 56e22eec54676d75 ]--- On hibernating, pm core calls into related hooks in sequence like: .freeze .freeze_noirq .thaw_noirq .thaw With .thaw_noirq hook being absent, the clock will be disabled in a unbalanced call which results the warning above. imx_uart_freeze() clk_prepare_enable() imx_uart_suspend_noirq() clk_disable() imx_uart_thaw clk_disable_unprepare() Adding the missing .thaw_noirq hook as imx_uart_resume_noirq() will have the call sequence corrected as below and thus fix the warning. imx_uart_freeze() clk_prepare_enable() imx_uart_suspend_noirq() clk_disable() imx_uart_resume_noirq() clk_enable() imx_uart_thaw clk_disable_unprepare() The Linux kernel CVE team has assigned CVE-2022-49841 to this issue. Affected and fixed versions =========================== Issue introduced in 4.16 with commit 09df0b3464e528c6a4ca2c48d9ff6d2fd7cbd775 and fixed in 4.19.267 with commit e401312ca6e180ee1bd65f6a766e99dd40aa95e7 Issue introduced in 4.16 with commit 09df0b3464e528c6a4ca2c48d9ff6d2fd7cbd775 and fixed in 5.4.225 with commit 476b09e07bd519ec7ba5941a6a6f9a02256dbb21 Issue introduced in 4.16 with commit 09df0b3464e528c6a4ca2c48d9ff6d2fd7cbd775 and fixed in 5.10.156 with commit 0a3160f4ffc70ee4bfa1521f698dace06e6091fd Issue introduced in 4.16 with commit 09df0b3464e528c6a4ca2c48d9ff6d2fd7cbd775 and fixed in 5.15.80 with commit ae22294e213a402a70fa1731538367d1b758ffe7 Issue introduced in 4.16 with commit 09df0b3464e528c6a4ca2c48d9ff6d2fd7cbd775 and fixed in 6.0.10 with commit e3f9d87d6f0732827c443bd1474df21c2fad704b Issue introduced in 4.16 with commit 09df0b3464e528c6a4ca2c48d9ff6d2fd7cbd775 and fixed in 6.1 with commit 4561d8008a467cb05ac632a215391d6b787f40aa 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-2022-49841 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/imx.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/e401312ca6e180ee1bd65f6a766e99dd40aa95e7 https://git.kernel.org/stable/c/476b09e07bd519ec7ba5941a6a6f9a02256dbb21 https://git.kernel.org/stable/c/0a3160f4ffc70ee4bfa1521f698dace06e6091fd https://git.kernel.org/stable/c/ae22294e213a402a70fa1731538367d1b758ffe7 https://git.kernel.org/stable/c/e3f9d87d6f0732827c443bd1474df21c2fad704b https://git.kernel.org/stable/c/4561d8008a467cb05ac632a215391d6b787f40aa