lkml.org 
[lkml]   [2022]   [Jan]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] KVM: x86/cpuid: Exclude unpermitted xfeatures for vcpu->arch.guest_supported_xcr0
On Mon, Jan 24, 2022, Like Xu wrote:
> On 24/1/2022 3:06 pm, Tian, Kevin wrote:
> > > From: Like Xu <like.xu.linux@gmail.com>
> > > Sent: Sunday, January 23, 2022 1:50 PM
> > >
> > > From: Like Xu <likexu@tencent.com>
> > >
> > > A malicious user space can bypass xstate_get_guest_group_perm() in the
> > > KVM_GET_SUPPORTED_CPUID mechanism and obtain unpermitted xfeatures,
> > > since the validity check of xcr0 depends only on guest_supported_xcr0.
> >
> > Unpermitted xfeatures cannot pass kvm_check_cpuid()...
>
> Indeed, 5ab2f45bba4894a0db4af8567da3efd6228dd010.
>
> This part of logic is pretty fragile and fragmented due to semantic
> inconsistencies between supported_xcr0 and guest_supported_xcr0
> in other three places:

There are no inconsistencies, at least not in the examples below, as the examples
are intended to work in host context. guest_supported_xcr0 is about what the guest
is/isn't allowed to access, it has no bearing on what host userspace can/can't do.
Or are you talking about a different type of inconsistency?

> - __do_cpuid_func

Reporting what KVM supports to host userspace.

> - kvm_mpx_supported

This is a check on host support.

> - kvm_vcpu_ioctl_x86_set_xsave

"write" from host userspace.

> Have you identified all their areas of use ?

\
 
 \ /
  Last update: 2022-01-24 17:24    [W:1.336 / U:0.420 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site