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

Re: [PATCH] x86/vmx: Revert "x86/VMX: sanitize rIP before re-entering guest"


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Thu, 6 Apr 2023 09:10:14 +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=dPefrZvcEibxdwrsmC7k+QiZGikHI68fSkhMQAQyOcE=; b=TwBCDa77dGpGQmSnhOQl+gPsFQfR6aoe+NQpHFpX5sGVtmXniljs8jz1z1Un+SfiD2hkRjAo9KMGG6VUj5m5p3W9Z2vRGBHV0THFxqlOaHqLCnFpEcZ/QyR41qUtbMFjCyKT8Zt93DGDHJ9rlIzDGKXG7U/ow4bw0AMYL7DobGXWKltIDHP9aYXAv2zZJlKjwWSSMlk11iskYmMvtfu60W4RX/5TdMtIvgSFkakQ6jhJqC6Nvqw25VXGi4ADT5b2uqmowGu252ajj+PbLhBKAC2lTwYWw2ntNKt1Vi/vi2BVEzAUnYunsOU406TwfaqNKRpb34SOotN+/+n94yuPGg==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=a/XvgeW/pYnjs2GLuD5j6QFjqW0aJbkKcayDwJIQ+H/ZIaaHV0H0SR1z7ERRnN6Q+RY4hmYYx7tKN1niEWEx0ngPwH46RYuK2QghV9rx0sMw7ixPAiXdr2R17cK8RqBdZQS9Z04mrr4IPOC055HyrX+2TRecEZ02out1/8djV7Et9R9oyM9gKGhfeJXPrmnmiAfJwTYXvfiYiDR0Kw9ilfbhah3ZeHu0gsCJW9Te8NlRIAUMpN1ihrHG2sfhhSKBixVKolcTrx5/0gY304TXLR3GDhDlG1Xwk/OePBSmXz8eBwVE8kqGJlowTy1DRLUj7sppwV5NazsrIOTG2Kr8Ug==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Roger Pau Monné <roger.pau@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Jun Nakajima <jun.nakajima@xxxxxxxxx>, Kevin Tian <kevin.tian@xxxxxxxxx>, Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • Delivery-date: Thu, 06 Apr 2023 07:10:45 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On 05.04.2023 23:52, Andrew Cooper wrote:
> At the time of XSA-170, the x86 instruction emulator was genuinely broken.  It
> would load arbitrary values into %rip and putting a check here probably was
> the best stopgap security fix.  It should have been reverted following c/s
> 81d3a0b26c1 "x86emul: limit-check branch targets" which corrected the emulator
> behaviour.
> 
> However, everyone involved in XSA-170, myself included, failed to read the SDM
> correctly.  On the subject of %rip consistency checks, the SDM stated:
> 
>   If the processor supports N < 64 linear-address bits, bits 63:N must be
>   identical
> 
> A non-canonical %rip (and SSP more recently) is an explicitly legal state in
> x86, and the VMEntry consistency checks are intentionally off-by-one from a
> regular canonical check.
> 
> The consequence of this bug is that Xen will currently take a legal x86 state
> which would successfully VMEnter, and corrupt it into having non-architectural
> behaviour.
> 
> Furthermore, in the time this bugfix has been pending in public, I
> successfully persuaded Intel to clarify the SDM, adding the following
> clarification:
> 
>   The guest RIP value is not required to be canonical; the value of bit N-1
>   may differ from that of bit N.
> 
> Fixes: ffbbfda377 ("x86/VMX: sanitize rIP before re-entering guest")
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

I am kind of okay with such a full revert, but I'd consider it quite helpful
if the description made clear why the alternative of instead doing the spec
mandated check isn't necessary / useful. The emulator having gained respective
checking is only part of the reason for this, aiui. Plus bugs may be
introduced into the emulator again, where the checking here could be a guard
against needing to issue an XSA in such a case.

Jan



 


Rackspace

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