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 96E29279335 for ; Sat, 4 Oct 2025 15:53:12 +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=1759593192; cv=none; b=XH8gGPz+wmIxAK6UQ6qzDXtjzINfst6QyuDYXpcIPdk3RDWErpn7sAKuuqO68EKLSLDsoMEfg4kqe3HaMuWy9MXsnZ4gQy+Ylw8JMWczolUvtp166MQcLhhJvhR/aVEYj6ulTvNH5PTcCfaah639gnOzsa57prVlQW7IC/iSNEY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759593192; c=relaxed/simple; bh=LaRrrrAPVMKsl5baS24SiibNExYplgsds+OL+pCpgW0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=e9gsXRuJRM5zpgW6HBkdPqNW0O3+qwZav0rlPX/7K+g59AhSf6W5t1WcbobMEzWQVRAy1D2i7zrvSmvt7MywpiCWAPARNLm5t4Cc7tqM01XQrl2W9pfBuOEjm9lPVPL0pQhvyYu9+bab354Pe9HTh9mNPER7MYN31FiSLS+oTak= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=FAIqvRk/; 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="FAIqvRk/" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CDA5C4CEF1; Sat, 4 Oct 2025 15:53:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759593192; bh=LaRrrrAPVMKsl5baS24SiibNExYplgsds+OL+pCpgW0=; h=From:To:Cc:Subject:Date:Reply-to:From; b=FAIqvRk/09+kGn3eE4gXFAe2wYTNWhOiAcMx9mnCO/GNBAWj1JrWfFqy9h8mjfWui j3G3n0euPB0SJ+PG3mWZ/92ArgJQmKzl7mC1X4UGO3uKlCNqe8cIpqxuKplIkXbsiO 2GFmakQo5n9Fokb5C+h60McxWjTLoYkCf2nW8vDE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-50491: coresight: cti: Fix hang in cti_disable_hw() Date: Sat, 4 Oct 2025 17:51:16 +0200 Message-ID: <2025100417-CVE-2022-50491-7a8b@gregkh> X-Mailer: git-send-email 2.51.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=4948; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=oGz80c1h9ONGREb6mLli1kySG7bH9adO56nEEDSGKys=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkPnUo1vzUkTntQwO1Rtnme6abPLwP/10WseXju3Z1tO 9cuNqoy6ohlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJ+HczzC9mvpd44cOXZ2Zm N5j52e4H7hezbmKYnyx8d9q8O/tfsc83i971NJi9+aOmLgA= 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: coresight: cti: Fix hang in cti_disable_hw() cti_enable_hw() and cti_disable_hw() are called from an atomic context so shouldn't use runtime PM because it can result in a sleep when communicating with firmware. Since commit 3c6656337852 ("Revert "firmware: arm_scmi: Add clock management to the SCMI power domain""), this causes a hang on Juno when running the Perf Coresight tests or running this command: perf record -e cs_etm//u -- ls This was also missed until the revert commit because pm_runtime_put() was called with the wrong device until commit 692c9a499b28 ("coresight: cti: Correct the parameter for pm_runtime_put") With lock and scheduler debugging enabled the following is output: coresight cti_sys0: cti_enable_hw -- dev:cti_sys0 parent: 20020000.cti BUG: sleeping function called from invalid context at drivers/base/power/runtime.c:1151 in_atomic(): 1, irqs_disabled(): 128, non_block: 0, pid: 330, name: perf-exec preempt_count: 2, expected: 0 RCU nest depth: 0, expected: 0 INFO: lockdep is turned off. irq event stamp: 0 hardirqs last enabled at (0): [<0000000000000000>] 0x0 hardirqs last disabled at (0): [] copy_process+0xa0c/0x1948 softirqs last enabled at (0): [] copy_process+0xa0c/0x1948 softirqs last disabled at (0): [<0000000000000000>] 0x0 CPU: 3 PID: 330 Comm: perf-exec Not tainted 6.0.0-00053-g042116d99298 #7 Hardware name: ARM LTD ARM Juno Development Platform/ARM Juno Development Platform, BIOS EDK II Sep 13 2022 Call trace: dump_backtrace+0x134/0x140 show_stack+0x20/0x58 dump_stack_lvl+0x8c/0xb8 dump_stack+0x18/0x34 __might_resched+0x180/0x228 __might_sleep+0x50/0x88 __pm_runtime_resume+0xac/0xb0 cti_enable+0x44/0x120 coresight_control_assoc_ectdev+0xc0/0x150 coresight_enable_path+0xb4/0x288 etm_event_start+0x138/0x170 etm_event_add+0x48/0x70 event_sched_in.isra.122+0xb4/0x280 merge_sched_in+0x1fc/0x3d0 visit_groups_merge.constprop.137+0x16c/0x4b0 ctx_sched_in+0x114/0x1f0 perf_event_sched_in+0x60/0x90 ctx_resched+0x68/0xb0 perf_event_exec+0x138/0x508 begin_new_exec+0x52c/0xd40 load_elf_binary+0x6b8/0x17d0 bprm_execve+0x360/0x7f8 do_execveat_common.isra.47+0x218/0x238 __arm64_sys_execve+0x48/0x60 invoke_syscall+0x4c/0x110 el0_svc_common.constprop.4+0xfc/0x120 do_el0_svc+0x34/0xc0 el0_svc+0x40/0x98 el0t_64_sync_handler+0x98/0xc0 el0t_64_sync+0x170/0x174 Fix the issue by removing the runtime PM calls completely. They are not needed here because it must have already been done when building the path for a trace. [ Fix build warnings ] The Linux kernel CVE team has assigned CVE-2022-50491 to this issue. Affected and fixed versions =========================== Issue introduced in 5.7 with commit 835d722ba10ac924adba1e8a46f2d80955222b4b and fixed in 5.10.154 with commit e33ce54cef5d429430e3b1ae5c8ee4f4103c4fdc Issue introduced in 5.7 with commit 835d722ba10ac924adba1e8a46f2d80955222b4b and fixed in 5.15.77 with commit 4c365a0c21aaf2b8fcc88de8dc298803288f61ac Issue introduced in 5.7 with commit 835d722ba10ac924adba1e8a46f2d80955222b4b and fixed in 6.0.7 with commit c51cfba50df8b9e16bfe0e6d4f2f252a4a10063d Issue introduced in 5.7 with commit 835d722ba10ac924adba1e8a46f2d80955222b4b and fixed in 6.1 with commit 6746eae4bbaddcc16b40efb33dab79210828b3ce 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-50491 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/hwtracing/coresight/coresight-cti-core.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/e33ce54cef5d429430e3b1ae5c8ee4f4103c4fdc https://git.kernel.org/stable/c/4c365a0c21aaf2b8fcc88de8dc298803288f61ac https://git.kernel.org/stable/c/c51cfba50df8b9e16bfe0e6d4f2f252a4a10063d https://git.kernel.org/stable/c/6746eae4bbaddcc16b40efb33dab79210828b3ce