From nobody Wed Sep 3 06:44:33 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6BF46C38A2D for ; Mon, 24 Oct 2022 12:20:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233280AbiJXMU3 (ORCPT ); Mon, 24 Oct 2022 08:20:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233299AbiJXMTI (ORCPT ); Mon, 24 Oct 2022 08:19:08 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF5087B29B; Mon, 24 Oct 2022 04:57:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1A26F61300; Mon, 24 Oct 2022 11:57:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2D26BC433C1; Mon, 24 Oct 2022 11:57:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612648; bh=jUROC4zzUDnOqA3R2EJJIUBUUCj8PuAErpT09V3rKDk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bDsBFMNf5nfDP8KIxRmsB7cvRYQVnPabDPN/+6IbL0k/SCFR1EB6KPMrg1NgNuRhB 58iLy30bEwNbXavpZ0z/4aq/i1xp/r2mzKWtGen62WAZ3sGux6qx84CP1V5iJFz8Mq t2cIQnyBi/j8laYW5LoQuvkZ84m3eUxW7EIG16oA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Michal Luczaj , Sean Christopherson Subject: [PATCH 4.19 067/229] KVM: x86/emulator: Fix handing of POP SS to correctly set interruptibility Date: Mon, 24 Oct 2022 13:29:46 +0200 Message-Id: <20221024113001.252481650@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Michal Luczaj commit 6aa5c47c351b22c21205c87977c84809cd015fcf upstream. The emulator checks the wrong variable while setting the CPU interruptibility state, the target segment is embedded in the instruction opcode, not the ModR/M register. Fix the condition. Signed-off-by: Michal Luczaj Fixes: a5457e7bcf9a ("KVM: emulate: POP SS triggers a MOV SS shadow too") Cc: stable@vger.kernel.org Link: https://lore.kernel.org/all/20220821215900.1419215-1-mhal@rbox.co Signed-off-by: Sean Christopherson Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/emulate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/x86/kvm/emulate.c +++ b/arch/x86/kvm/emulate.c @@ -1975,7 +1975,7 @@ static int em_pop_sreg(struct x86_emulat if (rc !=3D X86EMUL_CONTINUE) return rc; =20 - if (ctxt->modrm_reg =3D=3D VCPU_SREG_SS) + if (seg =3D=3D VCPU_SREG_SS) ctxt->interruptibility =3D KVM_X86_SHADOW_INT_MOV_SS; if (ctxt->op_bytes > 2) rsp_increment(ctxt, ctxt->op_bytes - 2);