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 4DEB21F3D32 for ; Fri, 27 Dec 2024 13:54:10 +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=1735307650; cv=none; b=bWRfseFT+flpANZwm/2Ex/gPIc3UDDRFk0HmY1/CYd+86C4VF7HV6ZNL2x/CDPq+n3G+RSBLQNKiCfNNhnncNnyo7yVVG5OcGePXRN8bJQFiDhqxwML4VjFz2hp4FlXusAh/2BspPrHrogIpw/O3LbgIVJjI8S+Gwm0V7kk0YS8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1735307650; c=relaxed/simple; bh=JE8AU4v7vNVfzyYqJIof9r/ygIRX5dv+KxYC9/WWUZ4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=mVNkqfaMD1njSifSCAtUlrlD1xRHNUndKHv6N9YfpAkLJDkHPkMjy1eQPukcks6RRT1YFVSxtjJxZajvGZ/Z5oXk/MDxcieSbaShYYcGXVlM7/n/3UQAIt73tlMgUVy9Mubqf176WWJwI6M1w80L4wSEvAKEyMbu9IuD/bn/lNY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1cVwTcR8; 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="1cVwTcR8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C6304C4CED0; Fri, 27 Dec 2024 13:54:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1735307650; bh=JE8AU4v7vNVfzyYqJIof9r/ygIRX5dv+KxYC9/WWUZ4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=1cVwTcR8mWcBkJAqHTEEIeWWj+3J+C/vLK3sreCdb1+5gZg9a6wm03E93ycJ4baEw jS5seYVaqQGZtNYjMg/tpHvslH2J/YtwKUOTShBIj6AnrdyumLmYB9rQnMnbGyFC/s c+j2YQtlqilvxKqVECIzRycglkhw7EgvhmYDPC+4= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-53196: KVM: arm64: Don't retire aborted MMIO instruction Date: Fri, 27 Dec 2024 14:52:42 +0100 Message-ID: <2024122725-CVE-2024-53196-758a@gregkh> X-Mailer: git-send-email 2.47.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=4264; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=JE8AU4v7vNVfzyYqJIof9r/ygIRX5dv+KxYC9/WWUZ4=; b=owGbwMvMwCRo6H6F97bub03G02pJDOl5GyXfnui/L2//1/VGwEqFriP9HnobVz/+vGx9+2l1U TH9Fo/XHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjARc0+GeSrGfXbFLfvrdsWw mrZZ3tJ9GJYdyTBXuGX2saTHy3r9JuZcb0x8NL/XN94UAA== 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: KVM: arm64: Don't retire aborted MMIO instruction Returning an abort to the guest for an unsupported MMIO access is a documented feature of the KVM UAPI. Nevertheless, it's clear that this plumbing has seen limited testing, since userspace can trivially cause a WARN in the MMIO return: WARNING: CPU: 0 PID: 30558 at arch/arm64/include/asm/kvm_emulate.h:536 kvm_handle_mmio_return+0x46c/0x5c4 arch/arm64/include/asm/kvm_emulate.h:536 Call trace: kvm_handle_mmio_return+0x46c/0x5c4 arch/arm64/include/asm/kvm_emulate.h:536 kvm_arch_vcpu_ioctl_run+0x98/0x15b4 arch/arm64/kvm/arm.c:1133 kvm_vcpu_ioctl+0x75c/0xa78 virt/kvm/kvm_main.c:4487 __do_sys_ioctl fs/ioctl.c:51 [inline] __se_sys_ioctl fs/ioctl.c:893 [inline] __arm64_sys_ioctl+0x14c/0x1c8 fs/ioctl.c:893 __invoke_syscall arch/arm64/kernel/syscall.c:35 [inline] invoke_syscall+0x98/0x2b8 arch/arm64/kernel/syscall.c:49 el0_svc_common+0x1e0/0x23c arch/arm64/kernel/syscall.c:132 do_el0_svc+0x48/0x58 arch/arm64/kernel/syscall.c:151 el0_svc+0x38/0x68 arch/arm64/kernel/entry-common.c:712 el0t_64_sync_handler+0x90/0xfc arch/arm64/kernel/entry-common.c:730 el0t_64_sync+0x190/0x194 arch/arm64/kernel/entry.S:598 The splat is complaining that KVM is advancing PC while an exception is pending, i.e. that KVM is retiring the MMIO instruction despite a pending synchronous external abort. Womp womp. Fix the glaring UAPI bug by skipping over all the MMIO emulation in case there is a pending synchronous exception. Note that while userspace is capable of pending an asynchronous exception (SError, IRQ, or FIQ), it is still safe to retire the MMIO instruction in this case as (1) they are by definition asynchronous, and (2) KVM relies on hardware support for pending/delivering these exceptions instead of the software state machine for advancing PC. The Linux kernel CVE team has assigned CVE-2024-53196 to this issue. Affected and fixed versions =========================== Issue introduced in 5.5 with commit da345174ceca052469e4775e4ae263b5f27a9355 and fixed in 6.1.120 with commit 6af853cf5f897d55f42e9166f4db50e84e404fb3 Issue introduced in 5.5 with commit da345174ceca052469e4775e4ae263b5f27a9355 and fixed in 6.6.66 with commit ea6b5d98fea4ee8cb443ea98fda520909e90d30e Issue introduced in 5.5 with commit da345174ceca052469e4775e4ae263b5f27a9355 and fixed in 6.11.11 with commit 1e46460efe1ef9a31748de7675ff8fe0d8601af2 Issue introduced in 5.5 with commit da345174ceca052469e4775e4ae263b5f27a9355 and fixed in 6.12.2 with commit d0571c3add987bcb69c2ffd7a70c998bf8ce60fb Issue introduced in 5.5 with commit da345174ceca052469e4775e4ae263b5f27a9355 and fixed in 6.13-rc1 with commit e735a5da64420a86be370b216c269b5dd8e830e2 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-2024-53196 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/arm64/kvm/mmio.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/6af853cf5f897d55f42e9166f4db50e84e404fb3 https://git.kernel.org/stable/c/ea6b5d98fea4ee8cb443ea98fda520909e90d30e https://git.kernel.org/stable/c/1e46460efe1ef9a31748de7675ff8fe0d8601af2 https://git.kernel.org/stable/c/d0571c3add987bcb69c2ffd7a70c998bf8ce60fb https://git.kernel.org/stable/c/e735a5da64420a86be370b216c269b5dd8e830e2