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 PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Sun, 10 Oct 2021 14:34:18 +0900 From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp> To: Sean Christopherson <seanjc@...gle.com>, Reiji Watanabe <reijiw@...gle.com>, Paolo Bonzini <pbonzini@...hat.com> Cc: syzkaller-bugs@...glegroups.com, linux-kernel@...r.kernel.org, syzbot <syzbot+9fc046ab2b0cf295a063@...kaller.appspotmail.com> Subject: Re: [syzbot] WARNING in static_key_slow_try_dec (2) Hello. Commit 4547700a4d190ac4 ("KVM: x86: Consolidate APIC base RESET initialization code") changed the location to set MSR_IA32_APICBASE_ENABLE flag. And syzbot is reporting underflow bug due to too late initialization of vcpu->arch.apic_base member. We need to make sure that vcpu->arch.apic_base is initialized before kvm_free_lapic() is called. kvm_vm_ioctl() { kvm_vm_ioctl_create_vcpu() { kvm_arch_vcpu_create() { if (something_went_wrong) goto fail_free_lapic; /* vcpu->arch.apic_base is initialized when something_went_wrong is false. */ kvm_vcpu_reset() { kvm_lapic_reset(struct kvm_vcpu *vcpu, bool init_event) { vcpu->arch.apic_base = APIC_DEFAULT_PHYS_BASE | MSR_IA32_APICBASE_ENABLE; } } return 0; fail_free_lapic: kvm_free_lapic() { /* vcpu->arch.apic_base is not yet initialized when something_went_wrong is true. */ if (!(vcpu->arch.apic_base & MSR_IA32_APICBASE_ENABLE)) static_branch_slow_dec_deferred(&apic_hw_disabled); // <= underflow bug. } return r; } } }
Powered by blists - more mailing lists