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 347BB1F9A89 for ; Wed, 16 Apr 2025 14:19:40 +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=1744813181; cv=none; b=YKguDw2ElrWdsZ7pCSO3jy31xZWWlUzRW0Lt0LIjQHNHRTcJk+pDUnsMfeizAUodSj1HCSV2vj1vW1yVW73a4Gg+6UUCjuBH2mx5yjDkpQp6Hu5ytSaygbWAvCR+3A2L/YXebNbFArK4oWA06OlY2DisEjBwzKmxBhESNqI37mI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744813181; c=relaxed/simple; bh=pD5Fu8LoqBrQcpWWtr4gyzC3588L8+yYjKyfV+CIkbw=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=KH+v49geSw1AUaRrrJWxAhwp7ErKhWEq0TwjVBkv/aHikIER4jlChAcu4CFxKt1b2aT35QmqXbDnCTIMTW2kNizjqzcK0cREuGoyNrOuS63EozD3lL2UvW1FTTAewPcuI7I4m1bH5plE7adeDdILjfnwUIsnpYMyJcT07XMi7KQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=uta6GLLB; 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="uta6GLLB" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 36F3AC4CEE2; Wed, 16 Apr 2025 14:19:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744813180; bh=pD5Fu8LoqBrQcpWWtr4gyzC3588L8+yYjKyfV+CIkbw=; h=From:To:Cc:Subject:Date:Reply-to:From; b=uta6GLLBOxICuYXLywxRZAG//UoSdxQeID3R+VDyDZxhl/FwfpNOXxQzyl+uwZ2yu joNBWHrR/aQuh91lB+mTHuXFKx+pfhPOkfyqh9IPLgBc0gddQQb1cCOiOYVNSjLfVp zb17yqhEE0RFbRIbyjmRzc1AQo6n6vlLXOloyKug= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-23135: RISC-V: KVM: Teardown riscv specific bits after kvm_exit Date: Wed, 16 Apr 2025 16:13:46 +0200 Message-ID: <2025041633-CVE-2025-23135-b4dd@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=4355; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=pD5Fu8LoqBrQcpWWtr4gyzC3588L8+yYjKyfV+CIkbw=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn/d108XbKM+a+lXNCpYltRSY/Jn0/+SO5YWqrmv/XIq rMfr9/o6ohlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJrC5lmM0eVbP48YcT9rul ntzbsJJ3qWtXoirD/KS0CSWpmnU7NvVteKt2OWFZ2oV6PQA= 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: RISC-V: KVM: Teardown riscv specific bits after kvm_exit During a module removal, kvm_exit invokes arch specific disable call which disables AIA. However, we invoke aia_exit before kvm_exit resulting in the following warning. KVM kernel module can't be inserted afterwards due to inconsistent state of IRQ. [25469.031389] percpu IRQ 31 still enabled on CPU0! [25469.031732] WARNING: CPU: 3 PID: 943 at kernel/irq/manage.c:2476 __free_percpu_irq+0xa2/0x150 [25469.031804] Modules linked in: kvm(-) [25469.031848] CPU: 3 UID: 0 PID: 943 Comm: rmmod Not tainted 6.14.0-rc5-06947-g91c763118f47-dirty #2 [25469.031905] Hardware name: riscv-virtio,qemu (DT) [25469.031928] epc : __free_percpu_irq+0xa2/0x150 [25469.031976] ra : __free_percpu_irq+0xa2/0x150 [25469.032197] epc : ffffffff8007db1e ra : ffffffff8007db1e sp : ff2000000088bd50 [25469.032241] gp : ffffffff8131cef8 tp : ff60000080b96400 t0 : ff2000000088baf8 [25469.032285] t1 : fffffffffffffffc t2 : 5249207570637265 s0 : ff2000000088bd90 [25469.032329] s1 : ff60000098b21080 a0 : 037d527a15eb4f00 a1 : 037d527a15eb4f00 [25469.032372] a2 : 0000000000000023 a3 : 0000000000000001 a4 : ffffffff8122dbf8 [25469.032410] a5 : 0000000000000fff a6 : 0000000000000000 a7 : ffffffff8122dc10 [25469.032448] s2 : ff60000080c22eb0 s3 : 0000000200000022 s4 : 000000000000001f [25469.032488] s5 : ff60000080c22e00 s6 : ffffffff80c351c0 s7 : 0000000000000000 [25469.032582] s8 : 0000000000000003 s9 : 000055556b7fb490 s10: 00007ffff0e12fa0 [25469.032621] s11: 00007ffff0e13e9a t3 : ffffffff81354ac7 t4 : ffffffff81354ac7 [25469.032664] t5 : ffffffff81354ac8 t6 : ffffffff81354ac7 [25469.032698] status: 0000000200000100 badaddr: ffffffff8007db1e cause: 0000000000000003 [25469.032738] [] __free_percpu_irq+0xa2/0x150 [25469.032797] [] free_percpu_irq+0x30/0x5e [25469.032856] [] kvm_riscv_aia_exit+0x40/0x42 [kvm] [25469.033947] [] cleanup_module+0x10/0x32 [kvm] [25469.035300] [] __riscv_sys_delete_module+0x18e/0x1fc [25469.035374] [] syscall_handler+0x3a/0x46 [25469.035456] [] do_trap_ecall_u+0x72/0x134 [25469.035536] [] handle_exception+0x148/0x156 Invoke aia_exit and other arch specific cleanup functions after kvm_exit so that disable gets a chance to be called first before exit. The Linux kernel CVE team has assigned CVE-2025-23135 to this issue. Affected and fixed versions =========================== Issue introduced in 6.4 with commit 54e43320c2ba0c70258a3aea690da38c6ea3293c and fixed in 6.13.11 with commit 1edb2de48616b11ee05e9a65d74c70abcb6d9939 Issue introduced in 6.4 with commit 54e43320c2ba0c70258a3aea690da38c6ea3293c and fixed in 6.14.2 with commit 1521cc04f0b6e737ff30105aa57fa9dde8493231 Issue introduced in 6.4 with commit 54e43320c2ba0c70258a3aea690da38c6ea3293c and fixed in 6.15-rc1 with commit 2d117e67f318303f6ab699a5511d1fac3f170545 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-23135 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: arch/riscv/kvm/main.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/1edb2de48616b11ee05e9a65d74c70abcb6d9939 https://git.kernel.org/stable/c/1521cc04f0b6e737ff30105aa57fa9dde8493231 https://git.kernel.org/stable/c/2d117e67f318303f6ab699a5511d1fac3f170545