Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp874185pxb; Tue, 1 Feb 2022 12:11:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJx82ZP2DV2VNi8djK0OdqaNCURn0UNB97k/+fZNuXsxsK9EvgfIFQnyyM/ba0tbV3eafUiz X-Received: by 2002:a17:907:7e92:: with SMTP id qb18mr23470692ejc.555.1643746306284; Tue, 01 Feb 2022 12:11:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643746306; cv=none; d=google.com; s=arc-20160816; b=jAE71MtYTCFVFsHaRW/bAiv+nwli3POXJOB+oi3Stdlw3hHztzV1Cy+kp6Z/I6WV4J IrIGdY6LvEGS4f/NvAu++yC9XDkABcLEphoAX7o3zAboyYy4Dpp2Btu0H+0IzbJ4SQ6t Y2k60BvgTOhBL7PbnbIrKgA/5adGKivzL+6ypDmtag7zBkBJFfJtW9hYcNAOAjokvMYX zxgsSWfsZT7E0coptCYGp08XNYAQReUeoCpkRoxtbItUpYf1QNULdCc39x9Wu+FJwB95 qC2QZT0jARj41mFg2iW9MCxCzX24htkVCL5p5RaoenZDmm/aimT0TQI0voQmLQwBoEfk N11Q== 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=+x64vklo13O5kXUG/SW6hVWNSGCBeIChOk56leq6qbs=; b=k4uwytU4dOd02nOKs6gORKIgh99weEXEjeks1QOV7j/MO8SoJN2KjwS9Gf9SeT/IcQ 1puEwobAhTT7cyasGJj/oDIg7TR/d4XakuRblp30v5Dg13GVr2uo6cZEs0NONIZPVTsl g+SdyMmu86z73/gEdSQ7U8ioWdRFsANhGJhdd+unjVdosAYKrx2vXlsQeAKswJIJInzb 2Ukkg4bkGI4x9CEmf8cUIPhJmwk22XrpvFLRBGYlAFFZD/24W4/AH8rhFAwWTwUcsb6M 7pj2Srmwmxec6PKA6CZbheS6pOj61zOGp4aEkt0hdP5KzsgCu/zuhihOOQbatI7nRod1 HQ3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xh35EZ76; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a20si9903308eda.71.2022.02.01.12.11.20; Tue, 01 Feb 2022 12:11:46 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xh35EZ76; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1379475AbiAaLjJ (ORCPT + 99 others); Mon, 31 Jan 2022 06:39:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378760AbiAaL3G (ORCPT ); Mon, 31 Jan 2022 06:29:06 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1EC2C0613EB; Mon, 31 Jan 2022 03:18:08 -0800 (PST) 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 ams.source.kernel.org (Postfix) with ESMTPS id 44B96B82A5D; Mon, 31 Jan 2022 11:18:08 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61257C340E8; Mon, 31 Jan 2022 11:18:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643627887; bh=mpfgD1264nYsnAM995Tl4rURc0002SYu7qwTBFLX8qg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xh35EZ76+cFeXz0z1qagsa9YqjC1k3irkx7oXADKnnX7RoxQ9nqp7nmhaAZiLHm0I 6w1UuvOI/Y4o/yu27IKoSsYiLaZcwBLVS0csRnxREVjbF0n8HGSpiZZy22UB13BIIA w4Gf7o8oNiLJmqFmhcoEA22smESAjr13RgkfBUqQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sean Christopherson , Vitaly Kuznetsov , Paolo Bonzini Subject: [PATCH 5.16 055/200] KVM: x86: Check .flags in kvm_cpuid_check_equal() too Date: Mon, 31 Jan 2022 11:55:18 +0100 Message-Id: <20220131105235.429648995@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220131105233.561926043@linuxfoundation.org> References: <20220131105233.561926043@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vitaly Kuznetsov commit 033a3ea59a19df63edb4db6bfdbb357cd028258a upstream. kvm_cpuid_check_equal() checks for the (full) equality of the supplied CPUID data so .flags need to be checked too. Reported-by: Sean Christopherson Fixes: c6617c61e8fe ("KVM: x86: Partially allow KVM_SET_CPUID{,2} after KVM_RUN") Signed-off-by: Vitaly Kuznetsov Message-Id: <20220126131804.2839410-1-vkuznets@redhat.com> Cc: stable@vger.kernel.org Signed-off-by: Paolo Bonzini Signed-off-by: Greg Kroah-Hartman --- arch/x86/kvm/cpuid.c | 1 + 1 file changed, 1 insertion(+) --- a/arch/x86/kvm/cpuid.c +++ b/arch/x86/kvm/cpuid.c @@ -113,6 +113,7 @@ static int kvm_cpuid_check_equal(struct orig = &vcpu->arch.cpuid_entries[i]; if (e2[i].function != orig->function || e2[i].index != orig->index || + e2[i].flags != orig->flags || e2[i].eax != orig->eax || e2[i].ebx != orig->ebx || e2[i].ecx != orig->ecx || e2[i].edx != orig->edx) return -EINVAL;