From mboxrd@z Thu Jan 1 00:00:00 1970 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 6777D215764 for ; Wed, 26 Feb 2025 02:14:07 +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=1740536047; cv=none; b=aQLVmkAdIxPXanpuy/Q5Ol8bS8EdMg810AuGPZWfZ7PcyeTD5FUKACKNSiBF/YyuWIXZwxJpQQhYVNNwMk2jL8wSbJssYROLM7kwaE6rw+xWNeKXUBtUs3LoQy/6zipFXk6MEMfMwILPcBt7SWtqmt0PeO5PUodTTx46zV35DwE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740536047; c=relaxed/simple; bh=hPzQhTsZXYVFEoZbMyoD4kPRuP6JetVd5FHyVx6Y72U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=aVfNTrBzuOcYfihHOx56prKlqfTBPnXLFIcg9CKUSlUIdi87VNr829AuKkDpSpInag05z7+gpW0amwg7KvLJo4p7A1QmcWdD3rIJMYURtdWw6DuKn9vPCFjJhYgxhIjuYAVBwGu2TnGLYxxYc/auYwgKsBtwCsHQzSlmh6Amlj4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nK1WWLVU; 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="nK1WWLVU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3AF07C4CEDD; Wed, 26 Feb 2025 02:14:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1740536047; bh=hPzQhTsZXYVFEoZbMyoD4kPRuP6JetVd5FHyVx6Y72U=; h=From:To:Cc:Subject:Date:Reply-to:From; b=nK1WWLVUjrg/HOCqgI8E6sd0y46f2iYOUA3BNmM9DGhSB7emI/O1FY3+aKQMtsnuT nKArtBj92f0sW2ABXWRla+mR6ifgnlZZudcSVzIQtO9UHha64Rvlv4+UMxcvuwLKcl As0jk4TKbkMQGM+xhE51QkGG3Q/YZy8+ddvpg3ys= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49383: watchdog: rzg2l_wdt: Fix 'BUG: Invalid wait context' Date: Wed, 26 Feb 2025 03:10:57 +0100 Message-ID: <2025022648-CVE-2022-49383-dfdc@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=4280; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=hPzQhTsZXYVFEoZbMyoD4kPRuP6JetVd5FHyVx6Y72U=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn7yt/YMflXmE+YY9Oy+Oz6FWUnLz3QFWTzKG9sPZa/+ ETxwprDHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRZb8Z5scv6H4r6j7v2wev oGfma7z+Hn3vfZJhDp/6H3eVHmXW9nuRbxa94JtxquC1FQA= 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: watchdog: rzg2l_wdt: Fix 'BUG: Invalid wait context' This patch fixes the issue 'BUG: Invalid wait context' during restart() callback by using clk_prepare_enable() instead of pm_runtime_get_sync() for turning on the clocks during restart. This issue is noticed when testing with renesas_defconfig. [ 42.213802] reboot: Restarting system [ 42.217860] [ 42.219364] ============================= [ 42.223368] [ BUG: Invalid wait context ] [ 42.227372] 5.17.0-rc5-arm64-renesas-00002-g10393723e35e #522 Not tainted [ 42.234153] ----------------------------- [ 42.238155] systemd-shutdow/1 is trying to lock: [ 42.242766] ffff00000a650828 (&genpd->mlock){+.+.}-{3:3}, at: genpd_lock_mtx+0x14/0x20 [ 42.250709] other info that might help us debug this: [ 42.255753] context-{4:4} [ 42.258368] 2 locks held by systemd-shutdow/1: [ 42.262806] #0: ffff80000944e1c8 (system_transition_mutex#2){+.+.}-{3:3}, at: __do_sys_reboot+0xd0/0x250 [ 42.272388] #1: ffff8000094c4e40 (rcu_read_lock){....}-{1:2}, at: atomic_notifier_call_chain+0x0/0x150 [ 42.281795] stack backtrace: [ 42.284672] CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 5.17.0-rc5-arm64-renesas-00002-g10393723e35e #522 [ 42.294577] Hardware name: Renesas SMARC EVK based on r9a07g044c2 (DT) [ 42.301096] Call trace: [ 42.303538] dump_backtrace+0xcc/0xd8 [ 42.307203] show_stack+0x14/0x30 [ 42.310517] dump_stack_lvl+0x88/0xb0 [ 42.314180] dump_stack+0x14/0x2c [ 42.317492] __lock_acquire+0x1b24/0x1b50 [ 42.321502] lock_acquire+0x120/0x3a8 [ 42.325162] __mutex_lock+0x84/0x8f8 [ 42.328737] mutex_lock_nested+0x30/0x58 [ 42.332658] genpd_lock_mtx+0x14/0x20 [ 42.336319] genpd_runtime_resume+0xc4/0x228 [ 42.340587] __rpm_callback+0x44/0x170 [ 42.344337] rpm_callback+0x64/0x70 [ 42.347824] rpm_resume+0x4e0/0x6b8 [ 42.351310] __pm_runtime_resume+0x50/0x78 [ 42.355404] rzg2l_wdt_restart+0x28/0x68 [ 42.359329] watchdog_restart_notifier+0x1c/0x30 [ 42.363943] atomic_notifier_call_chain+0x94/0x150 [ 42.368732] do_kernel_restart+0x24/0x30 [ 42.372652] machine_restart+0x44/0x70 [ 42.376399] kernel_restart+0x3c/0x60 [ 42.380058] __do_sys_reboot+0x228/0x250 [ 42.383977] __arm64_sys_reboot+0x20/0x28 [ 42.387983] invoke_syscall+0x40/0xf8 The Linux kernel CVE team has assigned CVE-2022-49383 to this issue. Affected and fixed versions =========================== Issue introduced in 5.17 with commit 2cbc5cd0b55fa2310cc557c77b0665f5e00272de and fixed in 5.17.15 with commit 6505541e5298cea2b79da68ee626f583f8e18784 Issue introduced in 5.17 with commit 2cbc5cd0b55fa2310cc557c77b0665f5e00272de and fixed in 5.18.4 with commit 0a635239cd5484d8f2e702713ccc49ec82aa7594 Issue introduced in 5.17 with commit 2cbc5cd0b55fa2310cc557c77b0665f5e00272de and fixed in 5.19 with commit e4cf89596c1f1e33309556699f910ced4abbaf44 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-49383 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/watchdog/rzg2l_wdt.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/6505541e5298cea2b79da68ee626f583f8e18784 https://git.kernel.org/stable/c/0a635239cd5484d8f2e702713ccc49ec82aa7594 https://git.kernel.org/stable/c/e4cf89596c1f1e33309556699f910ced4abbaf44