lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 10 Oct 2017 10:07:34 -0700
From:   Jim Mattson <jmattson@...gle.com>
To:     Wanpeng Li <kernellwp@...il.com>
Cc:     LKML <linux-kernel@...r.kernel.org>,
        kvm list <kvm@...r.kernel.org>,
        Paolo Bonzini <pbonzini@...hat.com>,
        Radim Krčmář <rkrcmar@...hat.com>,
        Wanpeng Li <wanpeng.li@...mail.com>
Subject: Re: [PATCH v3 2/2] KVM: VMX: Don't expose unrestricted_guest is
 enabled if ept is disabled

Reviewed-by: Jim Mattson <jmattson@...gle.com>

On Mon, Oct 9, 2017 at 3:51 PM, Wanpeng Li <kernellwp@...il.com> wrote:
> From: Wanpeng Li <wanpeng.li@...mail.com>
>
> SDM mentioned:
>
>  "If either the “unrestricted guest” VM-execution control or the “mode-based
>   execute control for EPT” VM- execution control is 1, the “enable EPT”
>   VM-execution control must also be 1."
>
> However, we can still observe unrestricted_guest is Y after inserting the kvm-intel.ko
> w/ ept=N. It depends on later starts a guest in order that the function
> vmx_compute_secondary_exec_control() can be executed, then both the module parameter
> and exec control fields will be amended.
>
> This patch fixes it by amending module parameter immediately during vmcs data setup.
>
> Reviewed-by: Jim Mattson <jmattson@...gle.com>
> Cc: Paolo Bonzini <pbonzini@...hat.com>
> Cc: Radim Krčmář <rkrcmar@...hat.com>
> Cc: Jim Mattson <jmattson@...gle.com>
> Signed-off-by: Wanpeng Li <wanpeng.li@...mail.com>
> ---
> v1 -> v2:
>  * reduce to just "enable_ept = 0"
>
>  arch/x86/kvm/vmx.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
> index ab0f16e..dedff59 100644
> --- a/arch/x86/kvm/vmx.c
> +++ b/arch/x86/kvm/vmx.c
> @@ -6730,16 +6730,13 @@ static __init int hardware_setup(void)
>         if (!cpu_has_vmx_ept() ||
>             !cpu_has_vmx_ept_4levels() ||
>             !cpu_has_vmx_ept_mt_wb() ||
> -           !cpu_has_vmx_invept_global()) {
> +           !cpu_has_vmx_invept_global())
>                 enable_ept = 0;
> -               enable_unrestricted_guest = 0;
> -               enable_ept_ad_bits = 0;
> -       }
>
>         if (!cpu_has_vmx_ept_ad_bits() || !enable_ept)
>                 enable_ept_ad_bits = 0;
>
> -       if (!cpu_has_vmx_unrestricted_guest())
> +       if (!cpu_has_vmx_unrestricted_guest() || !enable_ept)
>                 enable_unrestricted_guest = 0;
>
>         if (!cpu_has_vmx_flexpriority())
> --
> 2.7.4
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ