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] [day] [month] [year] [list]
Message-ID: <e393431b-9e5e-9bcb-c03a-d40baeafa435@redhat.com>
Date:   Fri, 21 Feb 2020 17:31:42 +0100
From:   Paolo Bonzini <pbonzini@...hat.com>
To:     Sean Christopherson <sean.j.christopherson@...el.com>,
        linmiaohe <linmiaohe@...wei.com>
Cc:     rkrcmar@...hat.com, vkuznets@...hat.com, wanpengli@...cent.com,
        jmattson@...gle.com, joro@...tes.org, tglx@...utronix.de,
        mingo@...hat.com, bp@...en8.de, hpa@...or.com, kvm@...r.kernel.org,
        linux-kernel@...r.kernel.org, x86@...nel.org
Subject: Re: [PATCH] KVM: X86: eliminate some meaningless code

On 21/02/20 16:23, Sean Christopherson wrote:
> 
> I'm guessing no VMM actually uses this ioctl(), e.g. neither Qemu or CrosVM
> use it, which is why the broken behavior has gone unnoticed.  Don't suppose
> you'd want to write a selftest to hammer KVM_{SET,GET}_CPUID2?
> 
> int kvm_vcpu_ioctl_get_cpuid2(struct kvm_vcpu *vcpu,
>                               struct kvm_cpuid2 *cpuid,
>                               struct kvm_cpuid_entry2 __user *entries)
> {
>         if (cpuid->nent < vcpu->arch.cpuid_nent)
>                 return -E2BIG;
> 
>         if (copy_to_user(entries, &vcpu->arch.cpuid_entries,
>                          vcpu->arch.cpuid_nent * sizeof(struct kvm_cpuid_entry2)))
>                 return -EFAULT;
> 
> 	cpuid->nent = vcpu->arch.cpuid_nent;
> 
>         return 0;
> }

I would just drop KVM_GET_CPUID2 altogether and see if someone complains.

Paolo

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ