[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH][4.17?] VMX: correct error handling in vmx_create_vmcs()


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Mon, 10 Oct 2022 12:25:20 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WoHimJzIzLxQ1QhsWTQCOEJZBtY6WWGzTNfOK95Ww9A=; b=Zyzb0pZYKVgEUtFRqEwC68n/Tn1e6yZ/lhYEm7TQzP6ey7/jJrd/D/k7j+OULxPUiZMwMGP3l1T1QRC3IYz+7nZVi2v9LUS/EgeY93sLjE2AF10s2NVB0p0dNVGoKUquDgHsAbH6pjpgnIiFgkbyPcFWTjmcQm5AAYu9EnP5nOyjNGu+wYyRbpCKO0Z/JWABu3Yu1YAuWjb+UUcSpqXkNBi3/GOVdvPUY9baYhD43Xt4Afye00J/V7k8M6ZsDrUMblPfg/xCKdoBriv15Ld09J9/lEN7e9AlSeVRZjXwN+qQkI4aD+BOo+iyKTbFTP5cFnfYE+4PueK2tnxH2FSe/A==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=E0s28RPbKYG+g6zLXgAVnCktb1B2BckzMk1+bJbVKy1sL0Ypvrbin+Ud4OYEJsrFtdkkJJ1UG1bhrjkWo7aunV+fiWOeDJmWoUAmSaB107UV165ql97x+Dhllq8fUqFQGAR94s/rdrDO4+1M2j3sk3DC0dyb/sZ3Vj4XNpcpXC0ySpN3gBL6cshBd1qgOrx2HKCh7c51F1d4cLEEmqhoaBa8/XXkzBAputT2L0/UJepYhfyaEgIEtpmMm29KQfmhnC0DqpkwO+L0T4RdmeP0/KOEwVf7ai+GqA4cRnZZhNz70gcS9GlBRNWEeFYjEuyPXMTlj5CuwkCwEJAPAqo9bQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Kevin Tian <kevin.tian@xxxxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Henry Wang <Henry.Wang@xxxxxxx>
  • Delivery-date: Mon, 10 Oct 2022 10:25:33 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

With the addition of vmx_add_msr() calls to construct_vmcs() there are
now cases where simply freeing the VMCS isn't enough: The MSR bitmap
page as well as one of the MSR area ones (if it's the 2nd vmx_add_msr()
which fails) may also need freeing. Switch to using vmx_destroy_vmcs()
instead.

Fixes: 3bd36952dab6 ("x86/spec-ctrl: Introduce an option to control L1D_FLUSH 
for HVM HAP guests")
Fixes: 53a570b28569 ("x86/spec-ctrl: Support IBPB-on-entry")
Reported-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
With both referenced commits having been for XSAs, we may want to
consider backporting this also to security-only stable trees. Otoh it's
"just" an error path ...

--- a/xen/arch/x86/hvm/vmx/vmcs.c
+++ b/xen/arch/x86/hvm/vmx/vmcs.c
@@ -1821,7 +1821,7 @@ int vmx_create_vmcs(struct vcpu *v)
 
     if ( (rc = construct_vmcs(v)) != 0 )
     {
-        vmx_free_vmcs(vmx->vmcs_pa);
+        vmx_destroy_vmcs(v);
         return rc;
     }
 



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.