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
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 10 Oct 2021 14:34:18 +0900
From:   Tetsuo Handa <>
To:     Sean Christopherson <>,
        Reiji Watanabe <>,
        Paolo Bonzini <>
        syzbot <>
Subject: Re: [syzbot] WARNING in static_key_slow_try_dec (2)


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;
      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