Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6810460rwi; Mon, 24 Oct 2022 06:27:12 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6/BuQqXevHXJNnGUdWNwUZV2oQeykEsPXTWykF821bvcEzHf0Dx565f8ctC8wUQ6XFxisQ X-Received: by 2002:a17:906:cc48:b0:7a8:4a3b:11f7 with SMTP id mm8-20020a170906cc4800b007a84a3b11f7mr4178987ejb.388.1666618031901; Mon, 24 Oct 2022 06:27:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666618031; cv=none; d=google.com; s=arc-20160816; b=r67AplBQXqlfC9fhuCGtSsC4rwL5ctJDgo1Xt2xEFQKV8i1mRQwUrU/EdAQFzSCNil GaHg7DP2mls+X/yze9e5ajneQpGzb4vAtq5fAidpbIUK1L4PuM3Gz+Os+1ekNIwiy/ZB OAafjGvwKcp2vxwzYeAGqXWEqBYuKOBYv9VP0gPzfC9QRjkRPKopM+GARKIx0q0OGAT+ 07J1xTfKvgEoBSL4QmVSBJ1nCH1S+LsvjRzNHXg1+CGGxWfTwfafTcF0cxzFiYmOeL4o +T710aD76ClyiVTB1KlzWvJQ1ihNIUb9MfPCIsn55MYQ52DhqQs7J2N9uJhmgNO0D+AQ ON5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=W8lSG+rNdh40VV2XnHKtFJ+Wje3QDhUsfh/71XqywQg=; b=odHJb1H5qyZ50Jyo7dOjv5kfO5sp5myV/P7P8mDUFnHGkPPeXGMoFNTyyhw7m3W6k3 d26txIIVIyjfYY1MqIxoPhCyPxtO7TC/SJMRZRKgBJGcnGMa+b+l3Xvw+5vzHa5zNZ1q ynSvVqJ4H2dugqhAvQ1Wcee7n3u4jPFmqHRplmDQCV9W4yo6+d+VdKaTe2rDEge5PSyP 8MQtWSL6rjCEr8MnKPHtJCgO7NcsolhxBKvJQlrQOrJf3gApaODW1VkdwJWU6SpZwrrO Z6U4ZFJlrm+Oc0STtqbXiDhcwrchpV/efLOjSWf1yFLiL95gqbTUnenPS+MP4YcMHv9o PBrw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Bku3akZ/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e19-20020a17090658d300b007829d30452asi34917353ejs.583.2022.10.24.06.26.46; Mon, 24 Oct 2022 06:27:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="Bku3akZ/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232411AbiJXMCp (ORCPT + 99 others); Mon, 24 Oct 2022 08:02:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47508 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232708AbiJXL7m (ORCPT ); Mon, 24 Oct 2022 07:59:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 450C77C751; Mon, 24 Oct 2022 04:48:41 -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 25D0761218; Mon, 24 Oct 2022 11:48:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A9D4C433D7; Mon, 24 Oct 2022 11:48:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612117; bh=z1NyuPD3NEIda2Y8V4lGbryOQIxzQNQE5QhUp+B71xs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bku3akZ/U1RJ9JtSoCn9YjB0qIstAoPHMi6ZMXq8k4GsYrS7fELn7/rnEWFdRb58C z8E6JZOoNp/ku/0F/U1cEK/aWTyEWQR6d0OW+Tw6xGv5/lVxTGcH3BL8dQ769RDgvt d1tTrQXOfLquSPu+4WP/scj/oQTl6felGDC4335I= 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.14 077/210] KVM: x86/emulator: Fix handing of POP SS to correctly set interruptibility Date: Mon, 24 Oct 2022 13:29:54 +0200 Message-Id: <20221024112959.567225844@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 @@ -1988,7 +1988,7 @@ static int em_pop_sreg(struct x86_emulat if (rc != X86EMUL_CONTINUE) return rc; - if (ctxt->modrm_reg == VCPU_SREG_SS) + if (seg == VCPU_SREG_SS) ctxt->interruptibility = KVM_X86_SHADOW_INT_MOV_SS; if (ctxt->op_bytes > 2) rsp_increment(ctxt, ctxt->op_bytes - 2);