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 B77243955EF; Tue, 12 May 2026 17:53:29 +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=1778608409; cv=none; b=JIjmzj9HGtzSn/QZH7CVCjb5x8H7Xa6pduV2t4+et0exoiBR4NwHnA50z7yAYrp64S9f9gg1+NajRfzbP1KUOzJQXa6wBLCSjXC982P4k93rsXEw8Z5I+QeNBiCkBNYv7FlFy6es+BmA9Lxh3BeOsbx3isaEXEfNzyIayVxdprY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1778608409; c=relaxed/simple; bh=7QiOQMY9Nzn1VhSVnjvb4gh2Pfw5KN7XEOsYippaX/0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B+YjUf4KQrnbYBv4N6dQuDQs2hzU+Gyjgq1rTGAWjcuj8Bzz31RRUHaKSGqtCz2UqgXYQaTyTBjj5GHfnzAzrMhPPxe6F8kVBwMZMDDlyFehJNBPsVqI/1CVqkfNRVaiXAWrGJVoF4A6Acesyhu+maO819JrH63iPijrD35dPps= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=EszIei0i; 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="EszIei0i" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 446C4C2BCB0; Tue, 12 May 2026 17:53:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1778608409; bh=7QiOQMY9Nzn1VhSVnjvb4gh2Pfw5KN7XEOsYippaX/0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EszIei0iv944VYrJfXv2Ebtt20DzgIbEJKz5NkNmHBLmawkbUHgdI18g31GOMQdZL 4FZyA+l6Hokk1odH4Kx+stbsrBR9ABqujB3g46t43t84A0AfmE5Ol5EoV0c2cFJ2P8 DhrqKYQ1wsTB2RY3cqzmGzqOoBIB03aKHBrQELuE= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bibo Mao , Tao Cui , Huacai Chen Subject: [PATCH 6.18 067/270] LoongArch: KVM: Fix missing EMULATE_FAIL in kvm_emu_mmio_read() Date: Tue, 12 May 2026 19:37:48 +0200 Message-ID: <20260512173939.861156633@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260512173938.452574370@linuxfoundation.org> References: <20260512173938.452574370@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tao Cui commit f26faae96c411a70641e4d21b759475caa6122d5 upstream. In the ldptr (0x24...0x27) opcode decoding path, the default case only breaks out but without setting "ret" value to EMULATE_FAIL. This leaves run->mmio.len uninitialized (stale from a previous MMIO operation) while "ret" value remains EMULATE_DO_MMIO, causing the code to proceed with an incorrect MMIO length. Add "ret = EMULATE_FAIL" to match the other default branches in the same function (e.g. the 0x28...0x2e and 0x38 cases). Cc: stable@vger.kernel.org Reviewed-by: Bibo Mao Signed-off-by: Tao Cui Signed-off-by: Huacai Chen Signed-off-by: Greg Kroah-Hartman --- arch/loongarch/kvm/exit.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/loongarch/kvm/exit.c +++ b/arch/loongarch/kvm/exit.c @@ -390,6 +390,7 @@ int kvm_emu_mmio_read(struct kvm_vcpu *v run->mmio.len = 8; break; default: + ret = EMULATE_FAIL; break; } break;