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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <40c066f0-7992-a574-c263-b6448dcfdcc9@amd.com>
Date:   Tue, 2 Mar 2021 13:29:23 -0600
From:   Babu Moger <babu.moger@....com>
To:     Sean Christopherson <seanjc@...gle.com>
Cc:     pbonzini@...hat.com, wanpengli@...cent.com, kvm@...r.kernel.org,
        joro@...tes.org, x86@...nel.org, linux-kernel@...r.kernel.org,
        mingo@...hat.com, bp@...en8.de, hpa@...or.com, vkuznets@...hat.com,
        tglx@...utronix.de, jmattson@...gle.com
Subject: Re: [PATCH] KVM: SVM: Clear the CR4 register on reset



On 3/2/21 1:20 PM, Sean Christopherson wrote:
> On Tue, Mar 02, 2021, Babu Moger wrote:
>> This problem was reported on a SVM guest while executing kexec.
>> Kexec fails to load the new kernel when the PCID feature is enabled.
>>
>> When kexec starts loading the new kernel, it starts the process by
>> resetting the vCPU's and then bringing each vCPU online one by one.
>> The vCPU reset is supposed to reset all the register states before the
>> vCPUs are brought online. However, the CR4 register is not reset during
>> this process. If this register is already setup during the last boot,
>> all the flags can remain intact. The X86_CR4_PCIDE bit can only be
>> enabled in long mode. So, it must be enabled much later in SMP
>> initialization.  Having the X86_CR4_PCIDE bit set during SMP boot can
>> cause a boot failures.
>>
>> Fix the issue by resetting the CR4 register in init_vmcb().
>>
>> Signed-off-by: Babu Moger <babu.moger@....com>
> 
> Cc: stable@...r.kernel.org
> 
> The bug goes back too far to have a meaningful Fixes.
> 
> Reviewed-by: Sean Christopherson <seanjc@...gle.com>

Sean, Thanks
> 
> 
> On a related topic, I think we can clean up the RESET/INIT flows by hoisting the
> common code into kvm_vcpu_reset().  That would also provide good motivation for
> removing the init_vmcb() call in svm_create_vcpu(), which is fully redundant
> with the call in svm_vcpu_reset().  I'll put that on the todo list.

Yes.Please.Thought about cleaning init_vmcb and svm_vcpu_reset little bit.
That will require some more tests and review. We didn't want to delay the
fix for that now.
Thanks
Babu

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ